4
votes

I am extremely new to Zend Framework, In registration form, i need label text in two line. For Example:- In the case First name, I need to display like below:

First
Name:

How can i implement this? Please anyone help me!!!

3
Could you clarify your question, since I don't know what you actually want to do. - Marcin
Thanks for your reply, That is i need to display a text box label in two line (I want to add a <br> tag inside one label text , Example: First<br> Name:)... - user588575

3 Answers

12
votes

By default, input fields labels are being escaped by Zend_View_Helper_FormLabel. However, you can easy switch this off:

$yourTextInputElement->getDecorator('label')->setOption('escape', false);

This way you can use labels as e.g. $yourTextInputElement->setLabel('First <br/> name');.

1
votes
0
votes

The best way is probably to use Description decorator, or subclass one of other standard ZF decorators.

Yanick's CSS solution might be a good choice too, depending what are you trying to do.