public function beforeAction($action) { // заглушка для предотвращения циклической ошибки if ($action instanceof ErrorAction) { return true; } if (!User::getCurrentGuide()) { throw new NotFoundHttpException(); } return true; }
public function actionIndex() { $serviceData = Service::getService(); $serviceAssocStyle = array('transfer' => array(0 => 1), 'service' => array(1 => 0, 2 => 5, 3 => 6, 4 => 2, 5 => 7, 6 => 3, 7 => 4)); $serviceItems = array(); if ($serviceData) { // первая услуга предоставление трансфера if ($serviceData['providing_shuttle']) { $serviceItems[] = array('type' => 'transfer', 'type_id' => 0, 'name' => 'Трансферы'); } // остальные услуги if (isset($serviceData['service_type']) && $serviceData['service_type']) { foreach ($serviceData['service_type'] as $value) { // не нужен гид-экскурсовод if ($value['type_id'] != 1) { $serviceItems[] = array('type' => 'service', 'type_id' => $value['type_id'], 'name' => $value['service_name']); } } } $serviceItems = \app\helpers\Arr::getChunkArrayByNum($serviceItems, 3, false); } return $this->render('index', ['guide' => User::getCurrentGuide(), 'serviceData' => $serviceData, 'serviceAssocStyle' => $serviceAssocStyle, 'serviceItems' => $serviceItems]); }
public function actionIndex() { return $this->render('index', ['guide' => User::getCurrentGuide(), 'cities' => Geo::getGuideCities(3), 'excursions' => Excursion::getExcursions(3), 'photos' => Photo::getPhotos(12)]); }
public function actionIndex() { return $this->render('index', ['guide' => User::getCurrentGuide(), 'excursions' => Excursion::getExcursions()]); }
public function actionIndex() { return $this->render('index', ['guide' => User::getCurrentGuide()]); }