{ $viewFile = $requestedFile = Yii::getAlias($viewFile); if ($this->theme !== null) { $viewFile = $this->theme->applyTo($viewFile); } if (is_file($viewFile)) { $viewFile = FileHelper::localize($viewFile); } else { throw new ViewNotFoundException("The view file does not exist: $viewFile"); } $oldContext = $this->context; if ($context !== null) { $this->context = $context; } $output = ''; $this->_viewFiles[] = [ 'resolved' => $viewFile,
* @since 2.0.1 */ public function renderContent($content) { $layoutFile = $this->findLayoutFile($this->getView()); if ($layoutFile !== false) { return $this->getView()->renderFile($layoutFile, ['content' => $content], $this); } return $content; } /**
* @return string the rendering result. * @throws InvalidArgumentException if the view file or the layout file does not exist. */ public function render($view, $params = []) { $content = $this->getView()->render($view, $params, $this); return $this->renderContent($content); } /** * Renders a static string by applying a layout. * @param string $content the static string being rendered * @return string the rendering result of the layout with the given static string as the `$content` variable.
} public function render($view, $params = array()) { if(isset(Yii::$app->user->identity->status) && Yii::$app->user->identity->status == User::STATUS_ON_MODERATE){ \app\widgets\UserNotActive\UserNotActiveAsset::register($this->view); } return parent::render($view, $params); } public function __construct($id, $module, $config = array()) { parent::__construct($id, $module, $config); // if ( !Yii::$app->session->isActive) Yii::$app->session->open(); if(!$this->layout && isset(\Yii::$app->params['defaultLayout'])){
if (isset($session['isDeti']) && $this->layout) { $this->layout = $session['isDeti'] ? 'deti' : $this->layout; } // if ( (in_array(Yii::$app->getRequest()->serverName,['art.lts'] )) && $this->layout && (isset(Yii::$app->ExhSettings['layout']))) { // $this->layout=Yii::$app->ExhSettings['layout']; // } return parent::render($view, $params); } public function actionPortfolio() { $id = \Yii::$app->user->id;
$watermark = (isset(Yii::$app->ExhSettings['view_watermark'])) ? Yii::$app->ExhSettings['view_watermark'] : false; $isDeti = $Exhibition->isDeti(); $this->layout = $isDeti ? 'deti' : $this->layout; $visible_voters = (isset(Yii::$app->ExhSettings['visible_voters'])) ? Yii::$app->ExhSettings['visible_voters'] : false; return $this->render('view', compact('visible_voters', 'isDeti', 'nomination', 'category', 'userLikedWorks', 'order', 'req_item_nominationByData', 'req_item_nomination', 'age', 'dataListFile', 'orderByData', 'orderByAge', 'namesKeysCounts', 'namesKeys', 'searchName', 'names', 'region', 'regions', 'isEco', 'id', 'Exhibition', 'reuestItems', 'pages', 'watermark')); } public function actionAddMore($id) { \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; $Exhibition = Exhibitions::findOne($id);
$args = $this->controller->bindActionParams($this, $params); Yii::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; }
$params = $this->catchAll; unset($params[0]); } try { Yii::debug("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } $response = $this->getResponse(); if ($result !== null) {
{ try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
$application = new yii\web\Application($config); $application->set('locator',$service); //if(YII_ENV == YII_ENV_DEV) Yii::$app->cache->flush(); $application->run();
$_GET = [ 'id' => '825', ]; $_SESSION = [ '__flash' => [], 'exh_id' => '825', 'ExhSettings' => [ 'button_url_addrequest' => '/exh_requests/requests', 'maket_diplom' => '/uploads/sert_background.jpg', 'visible_age' => '2', ], '_exh_id' => '825', ];