-- Arthur M. Kang <[EMAIL PROTECTED]> wrote
(on Wednesday, 27 February 2008, 03:55 PM -0800):
> I have a couple of questions regarding Zend_Form if anyone can help...
> 
> Setup:
> I'm using 1.5RC1 of the framework.
> Doing a simple test with:
> 
>     Action:
>     $form = new Zend_Form(array(
>       'action' => '/user/test',
>       'method' => 'post',
>       'elements' => array(
>         'username' => 'text'
>       )
>     ));
>     $this->view->form = $form;
> 
> 
>     View:
>     <?= $this->form ?>
> 
> Questions:
> 
>  1. If I put in $form->clearElements(); after I setup the form, I get:
>     Warning: Corruption detected in form; invalid key found in internal
>     iterator in /directory/Zend/Form.php on line 2125
>     Is that a bug or am I doing something wrong?

Could you clarify exactly when this happens? Does the exception occur
when you call clearElements(), or when making another method call later
after doing so?

>  2. Using 'attribs' for the form blows the action key.  You have to move the
>     action into the attribs.
>     $form = new Zend_Form(array(
>       'action' => '/user/test',
>       'method' => 'post',
>       'elements' => array(
>         'username' => 'text'
>       )
>     ));
>     Works. Form action is set in HTML.
> 
>     $form = new Zend_Form(array(
>       'action' => '/user/test',
>       'method' => 'post',
>       'attribs' => array('id'=>'testid', 'class'=>'testclass'),
>       'elements' => array(
>         'username' => 'text'
>       )
>     ));
>     Doesn't Work. Form action is not set in HTML.
> 
>     $form = new Zend_Form(array(
>       'method' => 'post',
>       'attribs' => array('action'=>'/user/test', 'id'=>'testid', 'class'=>
>     'testclass'),
>       'elements' => array(
>         'username' => 'text'
>       )
>     ));
>     Works. Form action is set in HTML.
> 
>     Again, is that a bug or is that the expected behavior?

Bug -- please file an issue. Thanks for the report!

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to