/** * @param $id * @param string $sortField * @return array|CatalogPages|CatalogPages[]|null */ public function get($id, string $sortField = '') { if (!$catalogPage = $this->findById($id, $sortField)) { throw new NotFoundException('Catalog Page is not found.'); } return $catalogPage; } /** * @return string */ public function imagesLocation(): string
* @param $id * @param string $sortField * @return array|CatalogPages|CatalogPages[]|null */ public function get($id, string $sortField = '') { return $this->catalogPagesRepository->get($id, $sortField); } /** * @param array|int $id * @param int $languageId * @param bool $asArray
* @param $id * @param string $sortField * @return array|CatalogPages|CatalogPages[]|null */ public function get($id, string $sortField = '') { return $this->catalogPagesRepository->get($id, $sortField); } public function getMenuHTML(array $tree, $current = false) { $current_depth = 0; $counter = 0;
{ global $breadcrumb; if ($this->catalogPagesService->getUrlPrefix()) { $breadcrumb->add(TEXT_CATEGORY_PAGE, Yii::$app->urlManager->createUrl(['catalog-pages'])); } $breadcrumb->add(BLOG_CONTENT_TEXT, Yii::$app->urlManager->createUrl(['catalog-pages/soderzhanie-bloga'])); $root = $this->catalogPagesService->get(4); $tree = $this->catalogPagesService->getTree($root, $this->languageId, $this->platformId); unset($tree[0]); $informations = $this->informationReadRepository->getListAllByCategory(array_map(static function($item){ return (int)$item['catalog_pages_id']; }, $tree), $this->languageId, $this->platformId, true);
$args = $this->controller->bindActionParams($this, $params); Yii::trace('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 */
public function runAction($id, $params = []) { if (!Yii::$app->request->isAjax){ $this->setMeta($id, $params); } return parent::runAction($id, $params); } protected function setMeta($id, $params) {
$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::trace("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__ . '/../../common/config/main-local.php'), require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main-local.php') ); $application = new yii\web\Application($config); $application->run();
* * For the full copyright and license information, please view the LICENSE file that was distributed with this source code. */ require('includes/application_top.php'); require(__DIR__ . '/lib/frontend/web/index.php'); require_once('includes/application_bottom.php');
$_SESSION = [ '__flash' => [], ];