public static function getFiltersForListGrid() { return array('country_id' => Country::getOptions('країна'), 'purpose_id' => TripPurpose::getOptions('ціль'), 'with_id' => TripWith::getOptions('з ким'), 'companion_id' => TripCompanion::getOptions('шукає')); }
public function actionCreateUpdateTrip($id = NULL) { $model = new TripForm(); $this->setAjaxResponseSuccessMessage('Поїздка запланована'); $this->setRedirectUrl($this->createUrl('myTrips')); $this->breadcrumbs = array('Головна' => $this->createUrl('site/index'), 'Туристичні знайомства' => $this->createUrl('index'), 'Мої поїздки' => $this->createUrl('myTrips'), 'Планування поїздку'); if ($id) { $this->breadcrumbs = array('Головна' => $this->createUrl('site/index'), 'Туристичні знайомства' => $this->createUrl('index'), 'Мої поїздки' => $this->createUrl('myTrips'), 'Редагування поїздки'); $this->setAjaxResponseSuccessMessage('Зміни збережені'); $model->load($id); } $this->setModel($model); if (isPostOrAjaxRequest()) { $this->process(); } $this->render('add-edit-trip', array('model' => $this->getModel(), 'purposeOptions' => TripPurpose::getOptions('Для'), 'withOptions' => TripWith::getOptions('Їду з'), 'companionOptions' => TripCompanion::getOptions('Шукаю'), 'countryOptions' => Country::getOptions('Їду в'))); }