*/ function saveMaxSavedFileCache($viewFile) { $etagActionIds = Yii::$app->cache->get('etagActionIds'); // The array key is Yii::$app->request->queryParams['cat'] . Yii::$app->request->queryParams['clean_url'] // or // The array key is Yii::$app->controller->id . Yii::$app->controller->action->id if (Yii::$app->controller->action->id == 'details') { if (!isset($etagActionIds[Yii::$app->request->queryParams['cat'] . Yii::$app->request->queryParams['clean_url']]['layout'])) { $etagActionIds[Yii::$app->request->queryParams['cat'] . Yii::$app->request->queryParams['clean_url']]['layout'] = []; } if (!in_array($viewFile, $etagActionIds[Yii::$app->request->queryParams['cat'] . Yii::$app->request->queryParams['clean_url']]['layout'])) { array_push($etagActionIds[Yii::$app->request->queryParams['cat'] . Yii::$app->request->queryParams['clean_url']]['layout'], $viewFile); } // de($etagActionIds[Yii::$app->request->queryParams['cat'] . Yii::$app->request->queryParams['clean_url']]); } elseif (Yii::$app->controller->action->id == 'info') { if (!isset($etagActionIds[Yii::$app->request->queryParams['cat'] . Yii::$app->controller->action->id]['layout'])) { $etagActionIds[Yii::$app->request->queryParams['cat'] . Yii::$app->controller->action->id]['layout'] = [];
$etagActionIds = Yii::$app->cache->get('etagActionIds'); // The array key is Yii::$app->request->queryParams['cat'] . Yii::$app->request->queryParams['clean_url'] // or // The array key is Yii::$app->controller->id . Yii::$app->controller->action->id if (Yii::$app->controller->action->id == 'details') { if (!isset($etagActionIds[Yii::$app->request->queryParams['cat'] . Yii::$app->request->queryParams['clean_url']]['layout'])) { $etagActionIds[Yii::$app->request->queryParams['cat'] . Yii::$app->request->queryParams['clean_url']]['layout'] = []; } if (!in_array($viewFile, $etagActionIds[Yii::$app->request->queryParams['cat'] . Yii::$app->request->queryParams['clean_url']]['layout'])) { array_push($etagActionIds[Yii::$app->request->queryParams['cat'] . Yii::$app->request->queryParams['clean_url']]['layout'], $viewFile); } // de($etagActionIds[Yii::$app->request->queryParams['cat'] . Yii::$app->request->queryParams['clean_url']]);
'secret_key' => $params['reCaptchaSecretKey'], ], 'view' => [ 'on afterRender' => function ($event) { /** @var $event yii\base\ViewEvent */ if (isset($event->viewFile)) { saveMaxSavedFileCache($event->viewFile); } }, ] /* 'urlManager' => [ 'enablePrettyUrl' => true,
$event->sender = $this; } $event->handled = false; $event->name = $name; foreach ($eventHandlers as $handler) { $event->data = $handler[1]; call_user_func($handler[0], $event); // stop further handling if the event is handled if ($event->handled) { return; } } }
$event = new ViewEvent([ 'viewFile' => $viewFile, 'params' => $params, ]); $event->output =& $output; $this->trigger(self::EVENT_AFTER_RENDER, $event); } } /** * Renders a view file as a PHP script. *
/* @var $renderer ViewRenderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $params, $output); } array_pop($this->_viewFiles); $this->context = $oldContext; return $output;
* @throws InvalidCallException if the view cannot be resolved. * @see renderFile() */ public function render($view, $params = [], $context = null) { $viewFile = $this->findViewFile($view, $context); return $this->renderFile($viewFile, $params, $context); } /** * Finds the view file based on the given view name. * @param string $view the view name or the [path alias](guide:concept-aliases) of the view file. Please refer to [[render()]] * on how to specify this parameter.
<!-- Block Detail --> <div class="blog-detail"> <div class="inner-box"> <?php if ($imageExists) { ?> <?= $this->render('../page/_lightbox_photos_new', [ 'content' => $content, 'images_location' => ($content->images_protection ? '' : Url::home() . 'images/page/'), 'cropper' => 0, 'image_height' => (($totalImages == 1) ? 'unset' : '300px'), 'image_border_radius' => '0' ]);
{ $_obInitialLevel_ = ob_get_level(); ob_start(); ob_implicit_flush(false); extract($_params_, EXTR_OVERWRITE); try { require $_file_; return ob_get_clean(); } catch (\Exception $e) { while (ob_get_level() > $_obInitialLevel_) { if (!@ob_end_clean()) { ob_clean(); }
$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]); } /* @var $renderer ViewRenderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $params, $output); } array_pop($this->_viewFiles); $this->context = $oldContext;
* @throws InvalidCallException if the view cannot be resolved. * @see renderFile() */ public function render($view, $params = [], $context = null) { $viewFile = $this->findViewFile($view, $context); return $this->renderFile($viewFile, $params, $context); } /** * Finds the view file based on the given view name. * @param string $view the view name or the [path alias](guide:concept-aliases) of the view file. Please refer to [[render()]] * on how to specify this parameter.
* These parameters will not be available in the layout. * @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
$content = replaceEvalTags($content); $relatedArticles = replaceEvalTags($relatedArticles); $this->setMetaTags($content); $session['pageId'] = $content->id; return $this->render( $content->layout_file, [ 'categoryLinks' => $categoryLinks, 'content' => $content, 'relatedPages' => $relatedPages, 'ref' => $ref,
$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();
require __DIR__ . '/../vendor/autoload.php'; require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php'; $config = require __DIR__ . '/../config/web.php'; (new yii\web\Application($config))->run();
$_GET = [ 'clean_url' => 'the-epwba-honors-members-at-the-manor', ]; $_SESSION = [ '__flash' => [], 'lastActivityTime' => 1711675705, 'params' => [ 'description' => 'Our Mission: The advancement of the professional interests of women licensed to practice law, the advancement of the cause of justice and the cause of women, and the nurturing and improvement of relations among women attorneys, and among the judiciary, the entire legal profession, and the community.', 'keywords' => '["Keyword A","Keyword B","Keyword C"]', 'orgEmail' => 'pixelbyteweb@gmail.com', 'orgEmailCc' => '["vsmelarkod@gmail.com"]', 'organizationNameLong' => 'El Paso Women\'s Bar Association', 'organizationName' => 'El Paso Women\'s Bar Association', 'organizationNameShort' => 'Company Name Shortform', 'siteTimeZone' => 'America/Denver', 'siteSlogan' => 'Please enter Site slogan here.', 'since' => '2000', 'city' => 'El Paso', 'state' => 'Texas', 'phoneNumberFormatted' => '(915) 503-1290', 'phoneNumber' => '+19155031290', 'faxNumberFormatted' => '1', 'address' => '5845 Cromo Dr. #2, El Paso, TX 79912', 'streetAddress' => '5845 Cromo Dr. #2', 'addressLocality' => 'El Paso', 'addressRegion' => 'TX', 'postalCode' => '79912', 'full_address' => '5845 Cromo Dr., Suite 2, El Paso, TX 79912', 'addressFormatted' => '5845 Cromo Dr., Suite 2, El Paso, TX 79912', 'hours' => '["08:00 AM-05:00 PM","08:00 AM-05:00 PM","08:00 AM-05:00 PM","08:00 AM-05:00 PM","08:00 AM-05:00 PM","closed","closed"]', 'googleMapsLink' => 'https://www.google.com/maps/place/5845+Cromo+Dr,+El+Paso,+TX+79912/@31.8170603,-106.5415146,17z/data=!3m1!4b1!4m5!3m4!1s0x86ddf80895497b15:0x552977339718e26d!8m2!3d31.8170603!4d-106.5393259', 'facebookReviewLink' => '#!', 'yelpReviewLink' => '0', 'googleReviewLink' => '#!', 'twitterLink' => 'www.twitter.com', 'instagramLink' => 'www.instagram.com', 'facebookLink' => 'https://www.facebook.com/groups/104940587664/', 'yelpLink' => '#!', 'linkedInLink' => '#!', 'googlePlusLink' => null, 'paypalDonateLink' => null, ], 'pageId' => 61, ];