Hi,
I am attempting to get my forms to have no html tags, I have attempted in
several ways, some came from here... http://mwop.net/blog/215-Rendering-
Zend_Form-decorators-individually (O'Phinney's site),
from that site I attempted the 'foreach' loop in my view script like so...
foreach ($form->getElements() as $element) {
$element->getDecorator('label')->setTag(null);
}
resulting in a "Call to a member function setTag() on a non-object" error,
as the same happens if I do this...
$this->removeDecorator('HtmlTag');
foreach ($this->getElements() as $element) {
$element->addDecorator('Label');
$element->getDecorator('Label')->setTag(null);
$element->removeDecorator('HtmlTag');
$element->removeDecorator('DtDdWrapper');
}
after all of my 'addElement' code in my form class (extends Zend_Form).
If I put the above code at the top of my init() function, it does nothing
at all...my labels still have the '<dt>' tags rendering like so...
<dt id="date-label"><label for="date" class="optional">Date
(DD/MM/YYYY):</label></dt>
I am trying to have no tags at all so I can call each element individually
in my veiw script and manipulate the form to my requirements, plus adding
<hr /> tags, etc.
Is there still a bug with setTag() ? do I have to add a decorator first,
then remove it? I'm a bit baffled on this one...
Thanks