php - Checkboxlist checked based on url $_GET -
I am checking my checkbox in Yii 1.1.15 based on existing page URL
> In my opinion:
$ arr0 = array ('1' => 'Store 1', '2' => 'Store2', '3 '= & Gt;' Store 3 '.......); Now $ form-> Checkbox list ($ model, 'store', $ arr0, array ('name' = & gt; 'store', 'separator' => gt; '', 'template' = & gt; '& lt; span class = "Col-md-6 col-xs-6" & gt; {input} & amp; nbsp; {label} & lt; / span & gt; ',' uncheckValue = & gt; 0));
And my URL looks like this
url /? Store = 1,4,5,6
Any idea how to do it? Set your model in your array before submitting it as below:
$ arr0 = array ('1', '2'); $ Models & gt; Store = $ arr0;
Now, 1,2 will be marked as selected.
Comments
Post a Comment