I was wandering is there any chance to use scenario for rules,
in my model I have
public function rules()
{
return array(
array(\'deliv
Yes its possible. In your controller you can check if checkbox checked or no, then set scenario. Something like that
if($_POST['my_checbox']==1)
$model->setscenario('checked');
Then just do $model->validate()
to check for errors.
In your model rules just set validators for scenarios you have:
array('delivery, firstNameBilling, lastNameBilling, addressBilling, cityBilling, countryBilling,
postBilling, telephoneBilling, mailBilling, firstNameDelivery, lastNameDelivery, addressDelivery,
cityDelivery, countryDelivery, postDelivery, telephoneDelivery, mailDelivery', 'required','on'=>'checked'),
Thats all. Pretty simple.