0
votes

I am new in zend framework. I want to populate company name and company id from database to select box. in zend

example as we do it PHP

<option value="<?php echo id ?>" > <?php echo $comapnyName ?>

this is my form

$this->addElement('select', 'companyName', array(           
    'required'   => true,
    'filters'    => array('StringTrim'),
    'style'    => array('width:103px'),
    'decorators'=> array(
        'ViewHelper','Errors'
    )
));

help me

1

1 Answers

0
votes

The parameter name is multiOptions and requires an array with the value=>companyName pairs for your option elements.

So either add it to your statement above when you create the element or later with $element->setMultiOptions($options)