ZF-2747: Zend_Form: Using attribs Causes action Key Not to Be Set
Description
Using 'attribs' for the form blows the action key. To get the form to generate properly, you have to move the action into the attribs array.
$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'
)
));
{color:red}Doesn't Work. Form action is not set in HTML.{color}
$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.
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2008-03-05T10:30:17.000+0000
Scheduling for 1.5.0GA release.
Posted by Matthew Weier O'Phinney (matthew) on 2008-03-06T14:13:05.000+0000
Resolved in trunk and merged to release-1.5 branch