setRouteHandler
void public static \Bitrix\Main\UrlPreview\Router::setRouteHandler( string $route, string $handlerModule, string $handlerClass, array $handlerParameters );
Static method adds or when route exists, update route handling method.
Parameters
Parameter | Description | Version |
---|---|---|
$route | URL route template. Route parameters must be enclosed into hash marks, for example: /user/#userId#/ . | |
$handlerModule | Route handler module. | |
$handlerClass | Route handler class must use the following methods:
| |
$handlerParameters | Array with parameters sent by the method into handler. Array must be passed as argument when calling handler method for creating a rich link or checking access permissions. Array with values must contain variables, referencing to route parameters, for example: ['userId' => '$userId'] . |
Exceptions
Example
© «Bitrix24», 2001-2024