コード例 #1
0
 /**
  * second sequence 
  * Method untuk menyimpan data tenant dan menampilkan form tenant
  */
 public function actionCreate()
 {
     $model = new Tenant();
     if (isset($_POST['Tenant'])) {
         $model->attributes = $_POST['Tenant'];
         if ($model->validate() && $model->save()) {
             echo CJSON::encode(array('status' => 'success', 'message' => 'Data tenant has been saved successfully !'));
         } else {
             $error = CActiveForm::validate($model);
             if ($error != '[]') {
                 echo $error;
             }
         }
         Yii::app()->end();
     }
     $this->renderPartial('_form', array('model' => $model, false, true));
 }