How do I set the id of the form in Zend_form
I would like to set the id of the form, I can set the id of its elements okay.
class Form_Purchase extends Zend_Form
{
protected $_id = 'purchase';
public function init()
{
开发者_开发技巧 ....
}
}
didn't work!
All I got was...
<form action="" method="post" enctype="application/x-www-form-urlencoded">
<dl class="zend_form">
....
Here is the code (put this line into the init method):
$this->setAttrib('id', $_id);
If in your case you can use the form name as the id, you could use this too, again in your init.
$this->setName($_id);
精彩评论