/var/www/vhosts/nabawater/vendor/yiisoft/yii2/web
NameSizeModeActions
migrations/-0755rm
Application.php58360644editdlrm
AssetBundle.php86020644editdlrm
AssetConverter.php45990644editdlrm
AssetConverterInterface.php6980644editdlrm
AssetManager.php255860644editdlrm
BadRequestHttpException.php10770644editdlrm
CacheSession.php36730644editdlrm
CompositeUrlRule.php44820644editdlrm
ConflictHttpException.php8140644editdlrm
Controller.php97390644editdlrm
Cookie.php20020644editdlrm
CookieCollection.php80940644editdlrm
DbSession.php76280644editdlrm
ErrorAction.php60920644editdlrm
ErrorHandler.php191410644editdlrm
ForbiddenHttpException.php11260644editdlrm
GoneHttpException.php10730644editdlrm
GroupUrlRule.php46960644editdlrm
HeaderCollection.php72360644editdlrm
HeadersAlreadySentException.php7000644editdlrm
HtmlResponseFormatter.php10920644editdlrm
HttpException.php17600644editdlrm
IdentityInterface.php36610644editdlrm
JqueryAsset.php4590644editdlrm
JsExpression.php12530644editdlrm
JsonParser.php17310644editdlrm
JsonResponseFormatter.php46770644editdlrm
Link.php20780644editdlrm
Linkable.php11090644editdlrm
MethodNotAllowedHttpException.php8330644editdlrm
MultiFieldSession.php46140644editdlrm
MultipartFormDataParser.php122710644editdlrm
NotAcceptableHttpException.php10630644editdlrm
NotFoundHttpException.php8080644editdlrm
RangeNotSatisfiableHttpException.php12120644editdlrm
Request.php656150644editdlrm
RequestParserInterface.php6690644editdlrm
Response.php413540644editdlrm
ResponseFormatterInterface.php5430644editdlrm
ServerErrorHttpException.php8270644editdlrm
Session.php345780644editdlrm
SessionIterator.php19780644editdlrm
TooManyRequestsHttpException.php10190644editdlrm
UnauthorizedHttpException.php11530644editdlrm
UnprocessableEntityHttpException.php11200644editdlrm
UnsupportedMediaTypeHttpException.php10940644editdlrm
UploadedFile.php88360644editdlrm
UrlManager.php258720644editdlrm
UrlNormalizer.php51030644editdlrm
UrlNormalizerRedirectException.php17580644editdlrm
UrlRule.php217070644editdlrm
UrlRuleInterface.php12230644editdlrm
User.php331100644editdlrm
UserEvent.php12290644editdlrm
View.php237450644editdlrm
ViewAction.php47180644editdlrm
XmlResponseFormatter.php56670644editdlrm
YiiAsset.php5040644editdlrm
Edit: /var/www/vhosts/nabawater/vendor/yiisoft/yii2/web/ViewAction.php (4718B)
* @author Qiang Xue * @since 2.0 */ class ViewAction extends Action { /** * @var string the name of the GET parameter that contains the requested view name. */ public $viewParam = 'view'; /** * @var string the name of the default view when [[\yii\web\ViewAction::$viewParam]] GET parameter is not provided * by user. Defaults to 'index'. This should be in the format of 'path/to/view', similar to that given in the * GET parameter. * @see \yii\web\ViewAction::$viewPrefix */ public $defaultView = 'index'; /** * @var string a string to be prefixed to the user-specified view name to form a complete view name. * For example, if a user requests for `tutorial/chap1`, the corresponding view name will * be `pages/tutorial/chap1`, assuming the prefix is `pages`. * The actual view file is determined by [[\yii\base\View::findViewFile()]]. * @see \yii\base\View::findViewFile() */ public $viewPrefix = 'pages'; /** * @var mixed the name of the layout to be applied to the requested view. * This will be assigned to [[\yii\base\Controller::$layout]] before the view is rendered. * Defaults to null, meaning the controller's layout will be used. * If false, no layout will be applied. */ public $layout; /** * Runs the action. * This method displays the view requested by the user. * @throws NotFoundHttpException if the view file cannot be found */ public function run() { $viewName = $this->resolveViewName(); $this->controller->actionParams[$this->viewParam] = Yii::$app->request->get($this->viewParam); $controllerLayout = null; if ($this->layout !== null) { $controllerLayout = $this->controller->layout; $this->controller->layout = $this->layout; } try { $output = $this->render($viewName); if ($controllerLayout) { $this->controller->layout = $controllerLayout; } } catch (ViewNotFoundException $e) { if ($controllerLayout) { $this->controller->layout = $controllerLayout; } if (YII_DEBUG) { throw new NotFoundHttpException($e->getMessage()); } throw new NotFoundHttpException( Yii::t('yii', 'The requested view "{name}" was not found.', ['name' => $viewName]) ); } return $output; } /** * Renders a view. * * @param string $viewName view name * @return string result of the rendering */ protected function render($viewName) { return $this->controller->render($viewName); } /** * Resolves the view name currently being requested. * * @return string the resolved view name * @throws NotFoundHttpException if the specified view name is invalid */ protected function resolveViewName() { $viewName = Yii::$app->request->get($this->viewParam, $this->defaultView); if (!is_string($viewName) || !preg_match('~^\w(?:(?!\/\.{0,2}\/)[\w\/\-\.])*$~', $viewName)) { if (YII_DEBUG) { throw new NotFoundHttpException("The requested view \"$viewName\" must start with a word character, must not contain /../ or /./, can contain only word characters, forward slashes, dots and dashes."); } throw new NotFoundHttpException(Yii::t('yii', 'The requested view "{name}" was not found.', ['name' => $viewName])); } return empty($this->viewPrefix) ? $viewName : $this->viewPrefix . '/' . $viewName; } }