$branchesAll = []; $output = ''; if (!$geoIP->isoCode) $geoIP->isoCode = 'JO'; $select_country = Country::find()->where(['status' => 1, 'code' => $geoIP->isoCode])->one(); if (!$select_country) $select_country = 'JO'; $select_country = Branches::find()->where(['status' => 1, 'default' => 1, 'country' => $select_country->id])->orderBy(['updated_at' => SORT_DESC])->one(); if (!$select_country) { $select_country = Branches::find()->where(['status' => 1, 'country' => $select_country->id])->orderBy(['updated_at' => SORT_DESC])->one(); } foreach ($countries as $key => $country) {
$geoIP->isoCode = 'JO'; $select_country = Country::find()->where(['status' => 1, 'code' => $geoIP->isoCode])->one(); if (!$select_country) $select_country = 'JO'; $select_country = Branches::find()->where(['status' => 1, 'default' => 1, 'country' => $select_country->id])->orderBy(['updated_at' => SORT_DESC])->one(); if (!$select_country) { $select_country = Branches::find()->where(['status' => 1, 'country' => $select_country->id])->orderBy(['updated_at' => SORT_DESC])->one(); }
$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 */
*/ public function actionIndex($slug = 'index') { //try to display action from controller try { return $this->runAction($slug, Yii::$app->request->get()); } catch (\yii\base\InvalidRouteException $ex) { } //try to display static page from datebase $page = Page::getDb()->cache(function ($db) use ($slug) {
$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__ . '/../../common/config/main.php'), require(__DIR__ . '/../config/main-local.php'), require(__DIR__ . '/../config/main.php') ); $application = new yii\web\Application($config); $application->run();
$_GET = [ 'slug' => 'contact', ]; $_SESSION = [ '__flash' => [], 'lysenkobv\\GeoIP\\GeoIP:34.229.223.223' => unserialize('O:22:"lysenkobv\\GeoIP\\Result":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.0481;s:9:"longitude";d:-77.4728;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:1:{s:7:"isoCode";s:2:"US";}}'), ];