ouhman
(Ouhman)
1
Hello,
I am trying to set fields required when inserting a new record like that:
array('image_thumb, image, image_medium, id_theme', 'required','on'=>'insert'),
But it doesn't work, when I click on create and if all fields are empty, the record is created.
Is there a better way to do that?
Thank you.
olafure
(Olafure)
2
Can you paste the entire rules() ?
Also, does it work when you just create the object like
?
ouhman
(Ouhman)
3
Here the entire rules :
And I am calling the right way, $obj=new record();
$obj-`save;
qiang
(Qiang Xue)
4
Did you set $model->scenario ?
ouhman
(Ouhman)
5
Thank you Qiang, i called :
And it works.