Hi
I'm building a Zend_Form and one of the elements is a "select" element,
which needs to be filled with optgroups and values to be rendered like this:
<select name="list" id="list">
<optgroup label="Jedis">
<option value="1" label="Obi">Obi</option>
<option value="2" label="Yoda">Yoda</option>
</optgroup>
<optgroup label="Siths">
<option value="3" label="Vader">Vader</option>
<option value="4" label="Maul">Maul</option>
</optgroup>
</select>
The passed data array is like this:
$s = new Zend_Form_Element_Select('list');
$data = array(
'Jedis' => array(1 => 'Obi', 2 => 'Yoda'),
'Siths' => array(3 => 'Vader', 4 => 'Maul')
);
$s->setMultiOptions($data);
But, there's a problem inside the "addMultiOption" function as it
tries to translate an array and it throws this error:
Warning: array_key_exists() [function.array-key-exists
<http://php/function.array-key-exists>]:
The first argument should be either a string or an integer in
C:\Documents and Settings\xvidal\Mis
documentos\projects\test\lib\Zend\Translate\Adapter.php on line *460*
--
Xavier Vidal Piera
Enginyer Tècnic Informàtic de Gestió
Tècnic Especialista Informàtic d'equips
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://web.xaviervidal.net
610.68.41.78