$this->view->params['crumbs'] = \yii\helpers\ArrayHelper::merge( [['href' => SystemProperty::getValueByKey('catalog_url'), 'name' => 'Каталог']], array_reverse($this->getBreadcrumbChain($model, []))); $this->registerSeo($model->seo); $subcategories = $model->getSubcategories()->where('subcategory_status=1')->orderBy(["subcategory_name" => SORT_ASC])->all(); $items_subcat_ids = getSubcatIds($model, []); $pagination = new Pagination(['totalCount' => Items::find()->where(['and', ['item_subcategory_id' => $items_subcat_ids], ['item_status' => 1]])->count(), 'pageSize' => self::CATEGORY_LIMIT]); $items = getItems(Items::find()->where(['item_subcategory_id' => $items_subcat_ids]), $pagination); return $this->render('category_index', ['subcategory' => $model, 'pagination' => $pagination, 'subcategories' => $subcategories, 'items' => $items]); } throw new \yii\base\Exception(\Yii::t('app', "Страница не найдена"), 404); } public function actionItem($artikul_id) { if ($model = Items::find()->with(['mainimage', 'subcategory'])->where('item_artikul=:artikul', [':artikul' => $artikul_id])->one()) { $this->view->params['crumbs'] = \yii\helpers\ArrayHelper::merge([ ['href' => SystemProperty::getValueByKey('catalog_url'), 'name' => 'Каталог']], array_reverse($this->getBreadcrumbChain($model->subcategory, [])), [['href' => $model->item_full_alias, 'name' => $model->item_name]]); $model->seo->seo_title = $model->seo->seo_title ? $model->seo->seo_title : $model->item_name; $model->seo->seo_meta_description = $model->seo->seo_meta_description ? $model->seo->seo_meta_description : 'Купить ' . $model->item_name; $this->registerSeo($model->seo);
$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 */
$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); Yii::$app->controller = $oldController; return $result; } else { $id = $this->getUniqueId(); throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
$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; } else { $response = $this->getResponse(); if ($result !== null) { $response->data = $result;
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->run();
$_GET = [ 'catalog_id' => 'phone-BlackBerry', ]; $_SERVER = [ 'PATH' => '/usr/local/bin:/usr/bin:/bin', 'TEMP' => '/tmp', 'TMP' => '/tmp', 'TMPDIR' => '/tmp', 'PWD' => '/', 'HTTP_ACCEPT' => '*/*', 'HTTP_CONNECTION' => 'close', 'CONTENT_LENGTH' => '0', 'HTTP_HOST' => 'master-mobile.by', 'HTTP_USER_AGENT' => 'claudebot', 'HTTP_X_FORWARDED_FOR' => '54.81.185.66', 'HTTP_X_CLIENT_IP' => '54.81.185.66', 'HTTP_X_FORWARDED_PROTO' => 'https', 'REDIRECT_UNIQUE_ID' => 'Zfl22dI0Dj376fP3CvhW3gAAAI4', 'REDIRECT_HTTPS' => 'on', 'REDIRECT_STATUS' => '200', 'UNIQUE_ID' => 'Zfl22dI0Dj376fP3CvhW3gAAAI4', 'HTTPS' => 'on', 'SERVER_SIGNATURE' => '', 'SERVER_SOFTWARE' => 'Apache/2.4.58', 'SERVER_NAME' => 'master-mobile.by', 'SERVER_ADDR' => '93.125.99.68', 'SERVER_PORT' => '443', 'REMOTE_ADDR' => '54.81.185.66', 'DOCUMENT_ROOT' => '/home/mastermo/public_html', 'REQUEST_SCHEME' => 'https', 'CONTEXT_PREFIX' => '', 'CONTEXT_DOCUMENT_ROOT' => '/home/mastermo/public_html', 'SERVER_ADMIN' => 'webmaster@master-mobile.by', 'SCRIPT_FILENAME' => '/home/mastermo/public_html/index.php', 'REMOTE_PORT' => '14012', 'REDIRECT_URL' => '/catalog/phone-BlackBerry', 'SERVER_PROTOCOL' => 'HTTP/1.0', 'REQUEST_METHOD' => 'GET', 'QUERY_STRING' => '', 'REQUEST_URI' => '/catalog/phone-BlackBerry', 'SCRIPT_NAME' => '/index.php', 'PHP_SELF' => '/index.php', 'REQUEST_TIME_FLOAT' => 1710847706.06254291534423828125, 'REQUEST_TIME' => 1710847706, 'argv' => [], 'argc' => 0, ]; $_ENV = [ 'PATH' => '/usr/local/bin:/usr/bin:/bin', 'TEMP' => '/tmp', 'TMP' => '/tmp', 'TMPDIR' => '/tmp', 'PWD' => '/', ];