Chapter 7: Improving the Dashboard
226
$data[‘colors’] = $this- > MColors- > getActiveColors();
$data[‘sizes’] = $this- > MSizes- > getActiveSizes();
$this- > load- > vars($data);
$this- > load- > view(‘dashboard’);
}
}
In the admin_product_create view, you ’ re going to process the $colors and $sizes data arrays inside
two separate fieldsets. The fieldsets will keep the checkboxes visually separate from the rest of the form.
Place the two fieldsets just above the Submit button.
echo form_fieldset(‘Colors’);
foreach ($colors as $key = > $value){
echo form_checkbox(‘colors[]’, $key, FALSE). $value;
}
echo form_fieldset_close();
echo form_fieldset(‘Sizes’);
foreach ($sizes as $key = > $value){
echo form_checkbox(‘sizes[]’, $key, FALSE). $value;
}
echo form_fieldset_close();
What you end up with is something akin to Figure 7 - 15.
Figure 7-15