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?
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?
If these are bugs, I can create issues...
Arthur