Ejemplo n.º 1
0
 public function actionIndex()
 {
     $this->pageName = Yii::t('ContactsModule.default', 'MARKERS');
     $this->breadcrumbs = array(Yii::t('ContactsModule.default', 'MODULE_NAME') => array('/admin/contacts'), $this->pageName);
     $mapsCount = ContactsMaps::model()->count();
     if ($mapsCount < 1) {
         $this->topButtons = false;
     }
     $model = new ContactsRouter('search');
     $model->unsetAttributes();
     $post = $_POST['ContactsRouter'];
     if (isset($post)) {
         $model->attributes = $post;
         if ($model->validate()) {
             $model->save();
             $this->redirect(array('index'));
         }
     }
     $this->render('index', array('model' => $model, 'mapsCount' => $mapsCount));
 }