Matthew,

Thank you for taking the time to answer my questions.  Replies below.

Matthew Weier O'Phinney wrote:
-- 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?
The exception occurs when the form is outputted in the view (<?= $this->form ?>). There are no further method calls. Just create the form, call clearElements, and then output the form. If this is a bug, I can file an issue.
 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!
Will do...

Reply via email to