From dfda14cb6163fc4716354769303ed6fe89d1e4dd Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Mon, 19 Sep 2022 15:17:19 +0200 Subject: [PATCH] update doc for class methods --- docs/30_Methods.md | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/docs/30_Methods.md b/docs/30_Methods.md index 01debac..9fdedc8 100644 --- a/docs/30_Methods.md +++ b/docs/30_Methods.md @@ -2,13 +2,15 @@ <!-- BEGIN DOC-COMMENT H2 ../src/tinyrouter.class.php --> -## namespace iml +--- +## `namespace iml` Axels first router --------------------------------------------------------------------------------<br> <br> THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE <br> LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR <br> OTHER PARTIES PROVIDE THE PROGRAM ?AS IS? WITHOUT WARRANTY OF ANY KIND, <br> EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED <br> WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE <br> ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. <br> SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY <br> SERVICING, REPAIR OR CORRECTION.<br> <br> --------------------------------------------------------------------------------<br> * -## public function __construct($aRoutes=[],$sUrl=false) +--- +## `public function __construct($aRoutes=[],$sUrl=false)` constructor **Parameters:** @@ -22,14 +24,16 @@ string | $sUrl | incoming url boolean -## protected function _getRoute() +--- +## `protected function _getRoute()` detect last matching route item if no route matches then it returns false **Return:** array -## public function setRoutes($aRoutes=[]) +--- +## `public function setRoutes($aRoutes=[])` set routes **Parameters:** @@ -42,7 +46,8 @@ $aRoutes | array | list of [ route, more params ... ] boolean -## public function setUrl($sUrl) +--- +## `public function setUrl($sUrl)` set incoming url, add the request behind protocol and domain. **Parameters:** @@ -55,7 +60,8 @@ sUrl | string | url to fetch; /api/v1/productbyid/3424084 boolean -## public function getUrlParts($sUrl=false) +--- +## `public function getUrlParts($sUrl=false)` helper function: get url request parts as array **Parameters:** @@ -68,35 +74,40 @@ $sUrl | string | url to handle; /api/v1/productbyid/3424084 array -## public function getRoute() +--- +## `public function getRoute()` detect last matching route item if no route matches then it returns false **Return:** array|bool -## public function getCallback() +--- +## `public function getCallback()` return the callback iten of the matching route If no route was matching it returns false **Return:** {*} -## public function getVars() +--- +## `public function getVars()` return the variables as keys in route parts with starting @ character **Return:** array -## public function getVar($sVarname) +--- +## `public function getVar($sVarname)` return the variables as keys in route parts with starting @ character **Return:** string -## public function getSubitems() +--- +## `public function getSubitems()` get an array with next level route entries releative to the current route **Return:** -- GitLab