开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜