-- Samuel Verdier <[EMAIL PROTECTED]> wrote
(on Thursday, 31 July 2008, 12:59 PM +0200):
> How can I recupe values $formData with populate function (
> without using addValue) ?
>
> $form->populate($formData);
>
> $titre = $this->createElement('text', 'titre');
> $titre->setLabel('title');
>
> echo $titre->getValue(); /*display nothing*/
>
> But if I do :
>
> $titre = $this->createElement('text', 'titre');
> $titre->setLabel('title')
> ->addValue('test');
>
> echo $titre->getValue(); /*display the title : test*/
populate() and setDefaults() work on the elements that _currently_ exist
within the form, plain and simple. This is why the first example fails
and the second works.
--
Matthew Weier O'Phinney
Software Architect | [EMAIL PROTECTED]
Zend Framework | http://framework.zend.com/