>
> class My_Form_Element_RawText extends Zend_Form_Element
> {
> public function render(Zend_View_Interface $view = null)
> {
> return $this->getValue();
> }
> }
>
> And that way you can re-use it to enter arbitrary text anywhere:
>
> $form->addElement('rawText', 'foo', array(
> 'value' => 'This is some text to insert somewhere...',
> ));
>
>
FYI, I had some funky issues with elements dissaprearing once I tried to
validate etc, so I also had to overide the isValid method in
Zend_Form_Element
//needs to always validate as true
public function isValid($value, $context = null)
{
return true;
}
--
View this message in context: http://www.nabble.com/Include-raw-HTML-into-Zend_Form-tp19031628p20036001.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论