How can I add extra HTML (such as a link) to my form element?

Answer

This can easily be done using
decorators. For instance using the Descripti
on decorator. It is important to note though that you will
need to turn off escaping for the output of the decorator:
$element
-
>setDecorators(array(
array('ViewHelper'),
array('Description', array('escape', false)),
array('Errors'),
array('
HtmlTag', array('tag' => 'dd')),
array('Label', array('tag' => 'dt')),
));
Now, you can use the following to add extra HTML to the element:
$element
-
>setDescription('<strong>This contains HTML that will actually be parsed by the browser, not
escaped</s
trong>');

All zend Framework 2 Questions

Ask your interview questions on zend-framework-2

Write Your comment or Questions if you want the answers on zend-framework-2 from zend-framework-2 Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---