user588575
user588575

Reputation: 51

zend form - Element Label in two line

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!!!

Upvotes: 4

Views: 2975

Answers (3)

takeshin
takeshin

Reputation: 50638

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.

Upvotes: 0

Marcin
Marcin

Reputation: 238139

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');.

Upvotes: 12

Yanick Rochon
Yanick Rochon

Reputation: 53526

What about this nifty solution ?

http://jsfiddle.net/J67GD/

Upvotes: 1

Related Questions