I am using Zend Framework in my project. I want to add a description/note to my forms, like
fields marked by * are mandatory
But i didn’t found how to add a description to a form and how to use it with decorators.
Any help will be highly appreciated. Thanks.
There are two options:
Zend_Form_Elementto create a customelement
I would go with the latter, since it is very common to add parts of raw html code to forms not only before elements or after, but among them also.
You should do something like this:
When extending
Zend_Form_Elementyou dont need to overidesetOption/s,getOption/smethods.Zend internally uses set* and get* and protected properties to detect element options like in this case
protected $raw_html;andpublic function setRawHtml($value)andpublic function getRawHtml()Also naming your property
$raw_htmlwill accept both options of ‘raw_html’ and ‘rawHtml’ respectively