Advertisement
eR1an9

SiteController.php

Oct 18th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.01 KB | None | 0 0
  1. public function actionIndex()
  2.     {
  3.         // return $this->render('index');
  4.         // return $this->redirect('/kepuasan/index');
  5.         $this->layout = 'front';
  6.         $model = new Kepuasan();
  7.         $kritik_saran = new KritikSaran();
  8.         $emot = new Emot();
  9.  
  10.         if ($model->load(Yii::$app->request->post()) && $model->save()) {
  11.              Yii::$app->session->setFlash('success', "Terimakasih");
  12.             return $this->redirect(['index']);
  13.         }
  14.         $datas = Emot::find()->All();
  15.         foreach ($datas as $data) {
  16.             echo $datas1 =  $data->emot_name."<br>";
  17.             $data = "<input id='visa$data->emot_id' type='radio' name='Kepuasan[pelayanan]' value='sangat_puas'>
  18.                    <label class='drinkcard-cc $data->emot_name' for='visa$data->emot_id'></label>";
  19.         }
  20.         return $this->render('_form', [
  21.             'data' => $data,
  22.             'model' => $model,
  23.             'kritik_saran' => $kritik_saran,
  24.             'emot' => $emot,
  25.         ]);
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement