-- OakBehringer <[EMAIL PROTECTED]> wrote
(on Monday, 02 June 2008, 09:50 PM -0700):
> Do I have to write a replacement for Zend_Form_Decorator_Label to have it
> wrapped in NO tag?
>
> When doing any of these...
>
> $someElement->getDecorator('Zend_Form_Decorator_Label')->setTag('');
> $someElement->getDecorator('Zend_Form_Decorator_Label')->setTag(null);
> $someElement->getDecorator('Zend_Form_Decorator_Label')->setTag(false);
>
> the tag that wraps around the label element resolves like this: <><label ...
> ></label></>
Actually, by default, the Label decorator does not use a tag. However,
if you are using the default decorators, it is configured to use one.
There is a bug in the setTag() logic, in that if an empty value is
passed, it actually casts it, incorrectly, to an empty string. I have
created an issue for this:
http://framework.zend.com/issues/browse/ZF-3371
In the meantime, you can simply re-add the decorator to the element:
$element->addDecorator('Label');
and the new Label decorator instances, sans tag, will replace the
original.
> I'm developing a form that has some highly customized html so I'm just doing
> a lot of this in my view-script:
>
> <?php echo $this->form->email; ?>
>
> Instead of just echoing the whole form. I won't be wrapping any of the
> elements in a definition list, but I would still like to use the label
> decorator.
--
Matthew Weier O'Phinney
Software Architect | [EMAIL PROTECTED]
Zend Framework | http://framework.zend.com/