|
| | done () |
| |
| | stripClosures ($value) |
| |
| | cache ($route, $key) |
| | Retrieve data from the route cache. More...
|
| |
| | save ($route, $key, $value) |
| | Save data to the route cache. More...
|
| |
| | enumLang ($params) |
| |
| | mask ($route, &$mask, &$slots) |
| | Parse a route and generate a mask (regex). More...
|
| |
| | data ($route) |
| | Parsed data for route. More...
|
| |
| | enum ($enum, $params, $data) |
| | Parse an (dynamic) enum. More...
|
| |
| | hash ($hash, $params) |
| | Calculate the hash for a set of parameters. More...
|
| |
| | encrypt ($encrypt, $params, &$keys) |
| | Encrypt 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 () |
| |
| | getSession () |
| |
| | publish ($property, $visibility=self::READABLE) |
| | Publish a property (or hide it again). More...
|
| |
| | alias ($alias, $property, $object=null) |
| | Define an alias for a property (of another object). 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 97 of file Router.php.
◆ data()
Parsed data for route.
- Parameters
-
- Returns
- array Data.
Definition at line 186 of file Router.php.
◆ done()
◆ encrypt()
| encrypt |
( |
|
$encrypt, |
|
|
|
$params, |
|
|
& |
$keys |
|
) |
| |
|
protected |
Encrypt a set of parameters.
- Parameters
-
| array | $encrypt | Encryption parameters. |
| array | $params | Route parameters (values). |
| array | $keys | Keys encrypted (return). |
- Returns
- string Encrypted data (binary).
Definition at line 228 of file Router.php.
◆ enum()
| enum |
( |
|
$enum, |
|
|
|
$params, |
|
|
|
$data |
|
) |
| |
|
protected |
Parse an (dynamic) enum.
- Parameters
-
| mixed | $enum | Raw enum. |
| array | $params | Current set of parameters. |
| array | $data | Route data. |
- Returns
- array
Definition at line 203 of file Router.php.
◆ enumLang()
◆ 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 303 of file Router.php.
◆ format()
Format a (default) route.
- Parameters
-
- Returns
- string Formatted route.
Definition at line 331 of file Router.php.
◆ getControllerName()
◆ getPathInfo()
◆ getViewType()
◆ hash()
Calculate the hash for a set of parameters.
- Parameters
-
| array | $hash | Hash configuration. |
| array | $params | Route parameters (values). |
- Returns
- string Hash.
Definition at line 212 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 239 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 143 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 (null = no match, false = unsatisfied enum).
Definition at line 251 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 342 of file Router.php.
◆ save()
| save |
( |
|
$route, |
|
|
|
$key, |
|
|
|
$value |
|
) |
| |
|
protected |
Save data to the route cache.
- Parameters
-
| string | $route | Route (set tot false for hash). |
| string | $key | |
| mixed | $value | Data for this route + key. |
Definition at line 128 of file Router.php.
◆ stripClosures()
◆ $_cache
◆ $_controllerName
◆ $_hashed
◆ $_save
◆ $_sharedCacheFile
Shared cache file for compiled routes.
Definition at line 60 of file Router.php.
◆ $_sharedCacheTtlSpread
| $_sharedCacheTtlSpread = 10 |
|
protected |
Random spread for TTL.
Definition at line 61 of file Router.php.
◆ $_viewType
◆ $defaultParams
Default params for routes.
Definition at line 50 of file Router.php.
◆ $encryptKey
Default encrypted data key.
Definition at line 58 of file Router.php.
◆ $enumTransTtl
Time-to-live for translated enum options.
Definition at line 55 of file Router.php.
◆ $hashAlgo
Default hash algo.
Definition at line 57 of file Router.php.
◆ $hashKey
◆ $prefix
Prefix to add before each route.
Definition at line 15 of file Router.php.
◆ $regexShortcuts
Initial value:= [
'*' => '\\d+',
'+' => '[1-9]\\d*'
]
Definition at line 51 of file Router.php.
◆ $routes
Available routes (key = route, value = controller data). Parameters can be present in a route (e.g.
Definition at line 16 of file Router.php.
◆ CACHE_HASH
| const CACHE_HASH = 'hash' |
◆ CACHE_HASHED
◆ CACHE_ROUTES
| const CACHE_ROUTES = 'routes' |
◆ CACHE_TIME
| const CACHE_TIME = 'time' |
◆ ENUM_DYNAMIC
◆ ENUM_TRANS
The documentation for this class was generated from the following file:
- /var/www/fred.local/vendor/rsi/fred/src/Rsi/Fred/Router.php