hii all,
I am developping appplication in yii2. in that i have one module's part is "Message Of Day" in that i required to take one checkbox for Message Active or Deactive. and for that i write this condition
if($model->message_of_day_active=='0')
{
$model->updateAll(['message_of_day_active'=>0]);
$model->message_of_day_active = 0;
}
else
{
$model->updateAll(['message_of_day_active'=>1]);
$model->message_of_day_active = 1;
}
in that Problem is Like if i not check on ckeckbox than also it take "1". means using this condition control goes directly in else part not in if part.
so please give me proper condition solution.
thanks in advance,
Jalpa patel