2010年10月27日星期三

[fw-mvc] Re: Forms and HTML

Thomas,

I'm having the same problem. I cannot use 'escape' => false when using
addElement the way you are using it. Instead, I'm doing the following:

$emailElement = new Zend_Form_Element_Text('email');
$emailElement -> setLabel('*Your email address:')
-> setRequired(true)
-> setValidators(array('EmailAddress'))
-> setFilters(array('StringTrim'))
-> setDescription('')
-> setDecorators(array(
'ViewHelper',
array('Description', array('escape' => false, 'tag' => false)),
array('HtmlTag', array('tag' => 'dd')),
array('Label', array('tag' => 'dt', 'escape' => false)),
'Errors',
));
$this->addElement($emailElement);


I'm very new to this, so I'm sure that's not the most elegant solution, but
it seems to work.
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Forms-and-HTML-tp3007790p3016637.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: