|
| | done () |
| |
| | cache ($route, $key) |
| | Retrieve data from the route cache. More...
|
| |
| | save ($route, $key, $value) |
| | Save data to the route cache. More...
|
| |
| | mask ($route, &$mask, &$slots) |
| | Parse a route and generate a mask (regex). More...
|
| |
| | data ($route) |
| | Parsed data for route. More...
|
| |
| | hash ($hash, $params) |
| | Calculate the hash for a set of parameters. More...
|
| |
| | hashed (&$key=null) |
| | Check if the current controller (+ action) has a hashed version. More...
|
| |
| | match ($path, $route) |
| | Check if a path matches a route and extract the parameters. More...
|
| |
| | format ($route) |
| | Format a (default) route. More...
|
| |
| | getControllerName () |
| |
| | getPathInfo () |
| |
| | getViewType () |
| |
| | init () |
| |
| | done () |
| |
| | getSession () |
| |
| | publish ($property, $visibility=self::READABLE) |
| | Publish a property (or hide it again). More...
|
| |
| | configure ($config) |
| | Configure the object. More...
|
| |
| | _get ($key) |
| | Default getter if no specific setter is defined, and the property is also not published (readable). More...
|
| |
| | _set ($key, $value) |
| | Default setter if no specific setter is defined, and the property is also not published (writeable). More...
|
| |
Definition at line 5 of file Router.php.
◆ cache()
Retrieve data from the route cache.
- Parameters
-
- Returns
- mixed Data for this route + key.
Definition at line 75 of file Router.php.
◆ data()
Parsed data for route.
- Parameters
-
- Returns
- array Data.
Definition at line 144 of file Router.php.
◆ done()
◆ execute()
Determine controller name and type.
If the controller name matches a route, the name will be translated to this route, and parameters present will be added to the $_GET.
- Parameters
-
| string | $path | If the path is not given, then the path after the script itself ('foo/bar' in '/index.php/foo/bar') will be used. |
Definition at line 226 of file Router.php.
◆ format()
Format a (default) route.
- Parameters
-
- Returns
- string Formatted route.
Definition at line 254 of file Router.php.
◆ getControllerName()
◆ getPathInfo()
◆ getViewType()
◆ hash()
Calculate the hash for a set of parameters.
- Parameters
-
| array | $hash | Hash configuration. |
| array | $parameters | Route parameters (values). |
- Returns
- string Hash.
Definition at line 160 of file Router.php.
◆ hashed()
Check if the current controller (+ action) has a hashed version.
- Parameters
-
- Returns
- array Keys for the parametes in the hash (or false if not found).
Definition at line 174 of file Router.php.
◆ mask()
| mask |
( |
|
$route, |
|
|
& |
$mask, |
|
|
& |
$slots |
|
) |
| |
|
protected |
Parse a route and generate a mask (regex).
- Parameters
-
| string | $route | |
| string | $mask | Resulting regex. |
| array | $slots | Slots for every paramter in the route. |
Definition at line 110 of file Router.php.
◆ match()
Check if a path matches a route and extract the parameters.
- Parameters
-
| string | $path | Path to check. |
| string | $route | Route to check against. |
- Returns
- string Controller name on match.
Definition at line 185 of file Router.php.
◆ reverse()
| reverse |
( |
|
$controller_name = null, |
|
|
|
$type = null, |
|
|
|
$params = null, |
|
|
|
$strict = true |
|
) |
| |
Determine a route from a controller name and type.
- Parameters
-
| string | $controller_name | (empty = current) |
| string | $type | |
| array | $params | Parameters to use with the route. |
| bool | $strict | Whether too check the format of the parameters. |
- Returns
- string Found route. Parameters that were not used in the route are added in the query.
Definition at line 265 of file Router.php.
◆ save()
| save |
( |
|
$route, |
|
|
|
$key, |
|
|
|
$value |
|
) |
| |
|
protected |
Save data to the route cache.
- Parameters
-
| string | $route | |
| string | $key | |
| mixed | $value | Data for this route + key. |
Definition at line 100 of file Router.php.
◆ $_cache
◆ $_controllerName
◆ $_hashed
◆ $_save
◆ $_sharedCacheFile
Shared cache file for compiled routes.
Definition at line 43 of file Router.php.
◆ $_viewType
◆ $defaultParams
Default params for routes.
Definition at line 35 of file Router.php.
◆ $hashAlgo
Default hash algo.
Definition at line 41 of file Router.php.
◆ $hashKey
◆ $prefix
Prefix to add before each route.
Definition at line 11 of file Router.php.
◆ $regexShortcuts
◆ $routes
Available routes (key = route, value = controller data). Parameters can be present in a route (e.g.
Definition at line 12 of file Router.php.
◆ CACHE_HASH
| const CACHE_HASH = 'hash' |
◆ CACHE_HASHED
◆ CACHE_ROUTES
| const CACHE_ROUTES = 'routes' |
The documentation for this class was generated from the following file:
- /var/www/fred.local/vendor/rsi/fred/src/Rsi/Fred/Router.php