-- Xavier Vidal Piera <[EMAIL PROTECTED]> wrote (on Wednesday, 07 May 2008, 10:03 AM +0200): > 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]: > 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
This is a known issue that only appears to affect PHP 5.1.4 on Windows; we are working on a solution, but have not found one yet. You can track it at: http://framework.zend.com/issues/browse/ZF-2974 -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/