[Solar-talk] form select options

Jeff Surgeson solar at 3hex.com
Tue Nov 6 12:51:57 CST 2007


Hi

Anyone tell me why when I create a data object  save the following it saves 
the numeric array key 0, 1 or 2 as apposed to the array value?

......etc
$item = $this->_gallery->fetchNew();
$data = $this->_request->post('gallery', array());
$item->load($data, $cols);
......etc
// get the form from the record
$form = $item->form($cols);
....etc
$form->setElements(array(
    'gallery[main_cat]'  => array(
        'type'          => 'select',
        'options'       => array('family', 'children', 'babies'),
    ),
));
....etc
$item->save();

-- 
...........::::::...........
Jeff Surgeson / South Africa


More information about the Solar-talk mailing list