The issue I had with it was the prepending of 'fieldset-' in the
Zend_Form_Decorator_Fieldset::render() method, when I had passed an id
attribute decorator setup.
I extended Zend_Form_Decorator_Fieldset and swapped:
if (!empty($id)) {
with:
if (!isset($attribs['id']) && !empty($id)) {
And that resolved my issue.
Regards,
Jay M. Keith
On Thu, Sep 4, 2008 at 10:07 AM, Matthew Weier O'Phinney
<matthew@zend.com> wrote:
> -- Jeremy Dunn <jeremy@jsdunn.info> wrote
> (on Thursday, 04 September 2008, 09:42 AM -0500):
>> I just updated my current project to 1.6 and noticed that the id of the
>> fieldset now has the text "fieldset-" prepended to the name I assign to
>> the display group:
>>
>> For example, in my form I have:
>>
>>
>> $this->addDisplayGroup($displayGroupArray,
>> 'contactUsForm',
>> array(
>> 'legend' => 'Contact Form',
>> )
>> );
>>
>> which now outputs:
>>
>> <fieldset id="fieldset-contactUsForm"><legend>Contact Form</legend>...</fieldset>
>>
>> Using 1.5.3 the id would only be id="contactUsForm". Bug?
>
> No, intended behavior. This way we don't get conflicting ids between the
> various elements used in decorators.
>
> For example, if you have the following decorators on a form:
>
> $form->setDecorators(array(
> 'FormElements',
> 'Fieldset',
> 'Form',
> ));
>
> the old behavior would have assigned the same ID to both the <form> and
> <fieldset> tags, which of course causes DOM issues. For 1.6.0, we
> modified this behavior to assure that they have distinct IDs.
>
> --
> Matthew Weier O'Phinney
> Software Architect | matthew@zend.com
> Zend Framework | http://framework.zend.com/
>
没有评论:
发表评论