public function redirect($url, $enforceRedirect = true)
    {
        $viewFile = $this->redirectView;
        if ($viewFile === null) {
            $viewFile = __DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'redirect.php';
        } else {
            $viewFile = Yii::getAlias($viewFile);
        }

        $viewData = [
            'url' => $url,
            'enforceRedirect' => $enforceRedirect,
        ];

        $response = Yii::$app->getResponse();
        $response->content = Yii::$app->getView()->renderFile($viewFile, $viewData);

        return $response;
    }
public function redirect($url, $enforceRedirect = true)
    {
        $viewFile = $this->redirectView;
        if ($viewFile === null) {
            $viewFile = __DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'redirect.php';
        } else {
            $viewFile = Yii::getAlias($viewFile);
        }

        $viewData = [
            'url' => $url,
            'enforceRedirect' => $enforceRedirect,
        ];

        $response = Yii::$app->getResponse();
        $response->content = Yii::$app->getView()->renderFile($viewFile, $viewData);

        return $response;
    }
public function redirect ( $ url , $ enforceRedirect = true ) { $ viewFile = $ this -> redirectView ; if ( $ viewFile === null ) { $ viewFile = __DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'redirect.php' ; } else { $ viewFile = Yii :: getAlias ( $ viewFile ) ; } $ viewData = [ 'url' => $ url , 'enforceRedirect' => $ enforceRedirect , ] ; $ response = Yii :: $ app -> getResponse ( ) ; $ response -> content = Yii :: $ app -> getView ( ) -> renderFile ( $ viewFile , $ viewData ) ; return $ response ; }
Redirect to the given URL or simply close the popup window.
@param mixed $url URL to redirect, could be a string or array config to generate a valid URL.
@param bool $enforceRedirect indicates if redirect should be performed even in case of popup window.
@return \yii\web\Response response instance.
Redirect to the given URL or simply close the popup window .