Exemplo n.º 1
0
 /**
  * Выбор города
  * @return string
  */
 public function actionChooseCity($city = null)
 {
     if (isset($city)) {
         $session = Yii::$app->session;
         $session->set('city', $city);
         $session->set('start-time', time());
         return $this->goHome();
     } else {
         $currentCity = FindCityByIp::find(Yii::$app->request->userIP);
         $cities = ArrayHelper::getColumn(Review::getAllCities(), 'name');
         return $this->renderAjax('chooseCity', ['currentCity' => $currentCity, 'cities' => $cities]);
     }
 }