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

后端 未结 7 552
夕颜
夕颜 2021-02-04 02:41

I\'m trying to add a plain text node in a zend form - the purpose is to only dispay some static text.

The problem is - im not aware of any such way to do it.

I

相关标签:
7条回答
  • 2021-02-04 03:33

    A little late but thought I'd throw it in anyway for the benefit of the community.

    Aine has hit the nail on the head. FormNote is what you need if you want to use text in Zend_Form. However, you can use it without needing to extend Zend_Form_Element_Xhtml. See example below:

    $text = new Zend_Form_Element_Text('myformnote');
    $text->setValue("Text goes here")
         ->helper = 'formNote';
    

    Note that you can use both text and html with the formNote helper.

    0 讨论(0)
提交回复
热议问题