|
SelfHelp WebApp
v2.0.6
A WebApp to Create WebApps for Studies in Human Sciences
|
Public Member Functions | |
| __construct ($db, $basePath, $routes=array(), $matchTypes=array()) | |
| get_asset_path ( $path) | |
| get_url ($url) | |
| is_active ( $route_name) | |
| has_route ($name) | |
| update_route () | |
Public Attributes | |
| $route = NULL | |
Private Attributes | |
| $db | |
An extension class to the altorouter library.
| Router::__construct | ( | $db, | |
| $basePath, | |||
$routes = array(), |
|||
$matchTypes = array() |
|||
| ) |
The constructor which calls the parent constructor.
| instance | $db | The instance of the service class PageDb |
| string | $basePath | The path prefix. |
| array | $routes | The array of existing routes. |
| array | $matchTypes | The set of types to match. |
| Router::get_asset_path | ( | $path | ) |
Get the path of an asset such that it matches with the base path.
| string | $path | The path to the asset. |
| string | The modified asset path. |
| Router::get_url | ( | $url | ) |
Returns an url given a router keyword. The keyword #back will generate the url of the last visited page or the home page if the last visited page is the current page or unknown. The keyword #self points to the current page.
| string | The generated url. |
| Router::has_route | ( | $name | ) |
Checks whether the given route exists.
| string | $name | The name of the route |
| bool | True if the route exists, false otherwise. |
Referenced by get_url().
| Router::is_active | ( | $route_name | ) |
Check whther the given route is active.
| string | $route_name | The name of the route to check. |
| bool | True if the given path is active, false otherwise. |
| Router::update_route | ( | ) |
Updates the route array.
|
private |
The instance of the service class PageDb.
Referenced by __construct().
| Router::$route = NULL |
The router array which holds the name, target, and parameters of a route.