setName('comment'); $author = new Zend_Form_Element_Text('author'); $author->setLabel('姓名')->setRequired(true) ->addFilter('StripTags') ->addFilter('StringTrim') ->addValidator('StringLength',false,array(3,50)); $email = new Zend_Form_Element_Text('email'); $email->setRequired(true)->setLabel('Email') ->addFilter('StringTrim') ->addValidator('NotEmpty')->addValidator('EmailAddress'); $url = new Zend_Form_Element_Text('url'); $url->addFilter('StringTrim')->setLabel('Website'); $content = new Zend_Form_Element_Textarea('content'); $content->addFilter('StringTrim')->setAttrib('cols',50)->setAttrib('rows',4)->addValidator('NotEmpty'); $spam=new element_bcSpamBlock('spam'); $spam->addPrefixPath('Validator','validator/','validate') ->addValidator('SpamBlock'); $id = new Zend_Form_Element_Hidden('id'); $uuid = new Zend_Form_Element_Hidden('uuid'); $redirect=new Zend_Form_Element_Hidden('redirect'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('评论'); $submit->setAttrib('id', 'commentbutton'); $this->addElements(array($author,$email, $url, $spam, $content, $submit,$id, $uuid)); $this->clearDecorators(); $this->addDecorator('FormElements') ->addDecorator('HtmlTag', array('tag' => '