How does one add a ‘plain text node’ to a zend form?


Zend has a form note view helper (Zend_View_Helper_FormNote), which you can use to add text.

Just create a new form element (/application/forms/Element/Note.php):

class Zend_Form_Element_Note extends Zend_Form_Element_Xhtml { public $helper = 'formNote'; } 

In your form:

$note = new Zend_Form_Element_Note( 'test', array('value' => 'This is a <b>test</b>') ); $this->addElement($note); 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s