См. определение в файле router.php строка 9
◆ convertRouteToRegexp()
static convertRouteToRegexp |
( |
string | $route, |
|
|
bool | $allowSlashes = false ) |
|
staticprotected |
Return regexp string for checking URL against route template.
- Аргументы
-
string | $route | Route URL template. |
bool | $allowSlashes | Allow slashes in regex search. |
- Возвращает
- string
См. определение в файле router.php строка 243
◆ dispatch()
static dispatch |
( |
Uri | $uri | ) |
|
|
static |
Returns handler for the url
- Аргументы
-
Uri | $uri | Absolute or relative URL. |
- Возвращает
- array|false Handler for this URL if found, false otherwise.
См. определение в файле router.php строка 84
◆ init()
Initializes router and prepares routing table.
- Возвращает
- void
См. определение в файле router.php строка 154
◆ invalidateRouteCache()
static invalidateRouteCache |
( |
| ) |
|
|
static |
Resets router cache
- Возвращает
- void
См. определение в файле router.php строка 260
◆ parseQueryParams()
static parseQueryParams |
( |
| $uriQuery | ) |
|
|
staticprotected |
◆ persistRoute()
static persistRoute |
( |
| $route, |
|
|
| $isNew ) |
|
staticprotected |
Persists routing table record in database
- Аргументы
-
string | $route | Route URL template. |
bool | $isNew | True if handler record was not encountered in router cache. |
- Возвращает
- bool Returns true if route is successfully stored in the database table, and false otherwise.
См. определение в файле router.php строка 203
◆ setRouteHandler()
static setRouteHandler |
( |
| $route, |
|
|
| $handlerModule, |
|
|
| $handlerClass, |
|
|
array | $handlerParameters ) |
|
static |
Adds, or, if route already exists, changes route handling method.
- Аргументы
-
string | $route | Route URL template. Route parameters should be enclosed in hash symbols, like '/user/#userId#/'. |
string | $handlerModule | Route handler module. |
string | $handlerClass | Route handler class should implement methods:
-
buildPreview($params): string. Method must accept array of parameters and return rendered preview
-
checkUserReadAccess($params): boolean. Method must accept array of parameters. Method must return true if currently logged in user has read access to the entity; false otherwise.
-
getCacheTag(): string. Method must return cache tag for the entity.
. |
array | $handlerParameters | Array of parameters, passed to the handler methods. Will be passed as the argument when calling handler's method for building preview or checking access. Array values may contain variables referencing route parameters. e.g. ['userId' => '$userId']. |
- Возвращает
- void
- Исключения
-
См. определение в файле router.php строка 44
◆ $initialized
◆ $managedCache
◆ $routeTable
◆ CACHE_ID
const CACHE_ID = 'UrlPreviewRouteCache' |
◆ CACHE_TTL
const CACHE_TTL = 315360000 |