Ejemplo n.º 1
0
 public function actionEditrerigional($id = null)
 {
     if ($id) {
         $one = Regional::getOne($id);
     } else {
         $one = new Regional();
     }
     $region = new Geo();
     if ($_POST['Regional']) {
         $one->attributes = $_POST['Regional'];
         // if ($model->load(Yii::$app->request->post()) && $model->save())
         if ($one->validate() && $one->save()) {
             if ($id) {
                 return $this->render('/edit/regional', ['model' => $one, 'region' => $region, 'ok' => 1]);
             } else {
                 return $this->redirect(['regional']);
             }
         }
     }
     return $this->render('/edit/regional', ['model' => $one, 'region' => $region]);
 }
 public function search(Request $request)
 {
     $regionales = Regional::where('nombre_regional', 'like', '%' . $request->nombre . '%')->get();
     return \View::make('Regional/list_regional', compact('regionales'));
 }