if($parent && $slug && $parent != $slug && $parent == 'katalog') { throw new NotFoundHttpException(Yii::t('app', 'Shop category not found.')); } } } // for seo if(!($parent == 'search' || $slug == 'search')) { if(!$parent) { if($parents = $cat->model->parents()->all()){ if(count($parents) && $parents[0]['slug'] != 'glavnaa'){ throw new NotFoundHttpException(Yii::t('app', 'Shop category not found.')); } } } } $countOnPage = Yii::$app->request->get('count', self::DEFAULT_ITEMS_IN_PAGE);
$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); 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; } 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();
require(__DIR__ . '/vendor/autoload.php'); require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php'); $config = require(__DIR__ . '/app/config/web.php'); (new yii\web\Application($config))->run();
$_GET = [ 'slug' => 'affiliate', ]; $_SESSION = [ '__flash' => [], 'app\\components\\GeoIp:34.230.84.106' => unserialize('O:26:"app\\components\\ResultGeoIp":2:{s:7:"' . "\0" . '*' . "\0" . 'data";a:7:{s:4:"city";a:2:{s:10:"geoname_id";i:4744870;s:5:"names";a:2:{s:2:"en";s:7:"Ashburn";s:2:"ru";s:12:"Ашберн";}}s:9:"continent";a:3:{s:4:"code";s:2:"NA";s:10:"geoname_id";i:6255149;s:5:"names";a:8:{s:2:"de";s:11:"Nordamerika";s:2:"en";s:13:"North America";s:2:"es";s:13:"Norteamérica";s:2:"fr";s:17:"Amérique du Nord";s:2:"ja";s:15:"北アメリカ";s:5:"pt-BR";s:17:"América do Norte";s:2:"ru";s:31:"Северная Америка";s:5:"zh-CN";s:9:"北美洲";}}s:7:"country";a:3:{s:10:"geoname_id";i:6252001;s:8:"iso_code";s:2:"US";s:5:"names";a:8:{s:2:"de";s:3:"USA";s:2:"en";s:13:"United States";s:2:"es";s:14:"Estados Unidos";s:2:"fr";s:11:"États-Unis";s:2:"ja";s:21:"アメリカ合衆国";s:5:"pt-BR";s:14:"Estados Unidos";s:2:"ru";s:6:"США";s:5:"zh-CN";s:6:"美国";}}s:8:"location";a:5:{s:15:"accuracy_radius";i:1000;s:8:"latitude";d:39.048099999999998;s:9:"longitude";d:-77.472800000000007;s:10:"metro_code";i:511;s:9:"time_zone";s:16:"America/New_York";}s:6:"postal";a:1:{s:4:"code";s:5:"20149";}s:18:"registered_country";a:3:{s:10:"geoname_id";i:6252001;s:8:"iso_code";s:2:"US";s:5:"names";a:8:{s:2:"de";s:3:"USA";s:2:"en";s:13:"United States";s:2:"es";s:14:"Estados Unidos";s:2:"fr";s:11:"États-Unis";s:2:"ja";s:21:"アメリカ合衆国";s:5:"pt-BR";s:14:"Estados Unidos";s:2:"ru";s:6:"США";s:5:"zh-CN";s:6:"美国";}}s:12:"subdivisions";a:1:{i:0;a:3:{s:10:"geoname_id";i:6254928;s:8:"iso_code";s:2:"VA";s:5:"names";a:6:{s:2:"en";s:8:"Virginia";s:2:"fr";s:8:"Virginie";s:2:"ja";s:18:"バージニア州";s:5:"pt-BR";s:9:"Virgínia";s:2:"ru";s:18:"Вирджиния";s:5:"zh-CN";s:15:"弗吉尼亚州";}}}}s:13:"' . "\0" . '*' . "\0" . 'attributes";a:0:{}}'), 'shopCity' => 'Ашберн', ];