Skip to content
Snippets Groups Projects
Commit 94f256b9 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update doc blocs

parent 81ce53f2
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@
* SERVICING, REPAIR OR CORRECTION.<br>
* <br>
* --------------------------------------------------------------------------------<br>
* @version 1.0
* @version 1.1
* @author Axel Hahn
* @link https://github.com/iml-it/appmonitor
* @license GPL
......@@ -34,12 +34,14 @@ class tinyrouter{
/**
* constructor
* @param $aRoutes array array of routings
* @param $aRoutes array array of routes
* @param $sUrl string incoming url
* @return boolean
*/
public function __construct($aRoutes=[], $sUrl=false){
public function __construct($aRoutes=[],$sUrl=false){
$this->setRoutes($aRoutes);
$this->setUrl($sUrl);
return true;
}
// ----------------------------------------------------------------------
......@@ -49,6 +51,7 @@ class tinyrouter{
/**
* detect last matching route item
* if no route matches then it returns false
* @return array
*/
protected function _getRoute(){
$aReturn=[];
......@@ -124,8 +127,9 @@ class tinyrouter{
}
/**
* set incoming url
* @param string sUrl url to fetch; https://api.exaple.com/
* set incoming url, add the request behind protocol and domain.
* @param string sUrl url to fetch; /api/v1/productbyid/3424084
* @return boolean
*/
public function setUrl($sUrl){
$this->sUrl=$sUrl;
......@@ -138,7 +142,8 @@ class tinyrouter{
// ----------------------------------------------------------------------
/**
* helper function: get url parts as array
* helper function: get url request parts as array
* @param string $sUrl url to handle; /api/v1/productbyid/3424084
* @returns array
*/
public function getUrlParts($sUrl=false){
......@@ -163,8 +168,9 @@ class tinyrouter{
}
/**
* return the callback of matching route
* @return string
* return the callback iten of the matching route
* If no route was matching it returns false
* @return {*}
*/
public function getCallback(){
return isset($this->aMatch['callback']) ? $this->aMatch['callback'] : false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment