Свойство | Тип | Описание | |
---|---|---|---|
$action | action to perform during route normalization. Available options are: - null - no special action will be performed - 301 - the request should be redirected to the normalized URL using permanent redirection - 302 - the request should be redirected to the normalized URL using temporary redirection - 404 - NotFoundHttpException will be thrown - callable - custom user callback, for example: php function ($route, $normalizer) { use custom action for redirections $route[1]['oldRoute'] = $route[0]; $route[0] = 'site/redirect'; return $route; } | ||
$collapseSlashes | whether slashes should be collapsed, for example site///index will be converted into site/index | ||
$normalizeTrailingSlash | whether trailing slash should be normalized according to the suffix settings of the rule |
Метод | Описание | |
---|---|---|
normalizePathInfo ( string $pathInfo, string $suffix, boolean &$normalized = false ) : string | Normalizes specified pathInfo. | |
normalizeRoute ( array $route ) : array | Performs normalization action for the specified $route. |
Метод | Описание | |
---|---|---|
collapseSlashes ( string $pathInfo ) : string | Collapse consecutive slashes in $pathInfo, for example converts site///index into site/index. | |
normalizeTrailingSlash ( string $pathInfo, string $suffix ) : string | Adds or removes trailing slashes from $pathInfo depending on whether the $suffix has a trailing slash or not. |
protected collapseSlashes ( string $pathInfo ) : string | ||
$pathInfo | string | raw path info. |
Результат | string | normalized path info. |
public normalizePathInfo ( string $pathInfo, string $suffix, boolean &$normalized = false ) : string | ||
$pathInfo | string | pathInfo for normalization |
$suffix | string | current rule suffix |
$normalized | boolean | if specified, this variable will be set to `true` if $pathInfo was changed during normalization |
Результат | string | normalized pathInfo |
public normalizeRoute ( array $route ) : array | ||
$route | array | route for normalization |
Результат | array | normalized route |
public $action |
public $collapseSlashes |