From 799554951b7f57ac2e14e890a1f233252d7ce04c Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 13 Feb 2023 02:43:31 +0100 Subject: [PATCH] Code cleaning in example app --- example/includes/url-public.php | 27 ++++++++++++++++++++++++--- example/public_html/index.php | 3 +-- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/example/includes/url-public.php b/example/includes/url-public.php index 249e315..4a39250 100644 --- a/example/includes/url-public.php +++ b/example/includes/url-public.php @@ -10,6 +10,11 @@ use function EesyPHP\vardump; if (php_sapi_name() == "cli") return true; +/** + * Search page handler + * @param EesyPHP\UrlRequest $request + * @return void + */ function handle_search($request) { global $status_list; @@ -107,10 +112,11 @@ function handle_search($request) { } Url :: add_url_handler('|^item/?$|', 'handle_search'); -/* - * One item pages +/** + * Show one item page handler + * @param EesyPHP\UrlRequest $request + * @return void */ - function handle_show($request) { $item = get_item_from_url($request -> id); if (!$item) @@ -131,6 +137,11 @@ function handle_show($request) { } Url :: add_url_handler('|^item/(?P[0-9]+)$|', 'handle_show'); +/** + * Create one item page handler + * @param EesyPHP\UrlRequest $request + * @return void + */ function handle_create($request) { global $status_list; @@ -214,6 +225,11 @@ function handle_modify($request) { } Url :: add_url_handler('|^item/(?P[0-9]+)/modify$|', 'handle_modify'); +/** + * Archive one item page handler + * @param EesyPHP\UrlRequest $request + * @return void + */ function handle_archive($request) { $item = get_item_from_url($request -> id); if(!is_array($item)) { @@ -236,6 +252,11 @@ function handle_archive($request) { } Url :: add_url_handler('|^item/(?P[0-9]+)/archive$|', 'handle_archive'); +/** + * Delete one item page handler + * @param EesyPHP\UrlRequest $request + * @return void + */ function handle_delete($request) { $item = get_item_from_url($request -> id); if(!is_array($item)) { diff --git a/example/public_html/index.php b/example/public_html/index.php index e42c9ce..1607d79 100644 --- a/example/public_html/index.php +++ b/example/public_html/index.php @@ -5,7 +5,6 @@ include 'url-public.php'; use EesyPHP\Url; -$default_url=''; -Url :: handle_request(); +Url :: handle_request(''); # vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab