Property | Type | Description | |
---|---|---|---|
$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 |
Method | Description | |
---|---|---|
normalizePathInfo ( string $pathInfo, string $suffix, boolean &$normalized = false ) : string | Normalizes specified pathInfo. | |
normalizeRoute ( array $route ) : array | Performs normalization action for the specified $route. |
Method | Description | |
---|---|---|
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. |
return | 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 |
return | string | normalized pathInfo |
public normalizeRoute ( array $route ) : array | ||
$route | array | route for normalization |
return | array | normalized route |
public $action |
public $collapseSlashes |