Codxplore.com

Latest news: New android application Islamic Video has been released. its a free islamic video application for android smartphone. Download now!


  Its called 'scenarios': http://www.yiiframework.com/doc-2.0/guide-structure-models.html#scenarios in model: public function rules() { return [ ['title', 'required', 'on' => 'create'] ]; } in controller: public function actionCreate() { $model = new Item(); $model->scenario = 'create'; ... } You'd better define scenario as a constant though.   source : http://stackoverflow.com/questions/29449019/yii2-validate-only-create-action

Views: 3299


Form code :  $form = $this->beginWidget('CActiveForm', array(                         'id' => 'aa--aprvl--setup-_form-form',                         // Please note: When you enable ajax validation, make sure the corresponding                         // controller action is handling ajax validation correctly.                &nb....

Views: 775

Subscribe Us


Follow Us