This is nuts. I have searched and guessed. I am out of bullets.
Can anyone please show me how CheckBoxList works?
Form:
<?= $form->field($model, 'notify[]')->checkboxList($model->getNotifyKeys(), ...WHAT GOES HERE ) ?>
Here is the list returned by getNotifyKeys:
return [
self::APPROVAL =>'Approvals',
self::ENCODING_READY =>'Video encoding ready',
self::FRIEND_ACCEPT =>'Friend request accepted',
self::PM =>'Private message on site',
self::NEWSLETTER =>'Newsletter',
self::FORUM_POST =>'Forum post to subscribed thread',
self::RECEIPT =>'Receipt for payment',
self::VIDEO_COMMENT =>'Comment on your video',
self::EXPIRY_REMINDER =>'Membership expiry reminder',
];
What do I put in the arguments to CheckBoxList to have, say NEWSLETTER already checked?
http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#activeCheckboxList()-detail
http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#checkbox()-detail
A sample. An example. SHOW ME THE CODE !!
Please and thank you.