web\UrlNormalizer $action

$action public property

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 - yii\web\NotFoundHttpException will be thrown
  • callable - custom user callback, for example:

    function ($route, $normalizer) {
        // use custom action for redirections
        $route[1]['oldRoute'] = $route[0];
        $route[0] = 'site/redirect';
        return $route;
    }
    
public integer|callable|null $action = self::ACTION_REDIRECT_PERMANENT
doc_Yii
2016-10-30 17:17:04
Comments
Leave a Comment

Please login to continue.