Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

formCollection View Helper doesn't render name #86

Open
@GeeH

Description

@GeeH

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7687
User: @gregGit
Created On: 2016-03-14T16:20:39Z
Updated At: 2016-04-13T07:48:07Z
Body
When using form view helper, the formCollection view helper is used to render fieldset.
But form some reason that i don't understand this view helper doesn't set the name attribute in the fieldset (unset($attributes['name']); in the render Method).
I belive name is a valid html attributes for fieldset i don't understand why ZF2 never render this tag in a fieldset, and it can be usefull to have it in the DOM.

For test create an action like this :

  $fs = new \Zend\Form\Fieldset('my-fieldset');
        $fs->setAttribute('name', 'my-fieldset');
        $fs->add(array(
            'type' => 'text',
            'name' => 'text',
            'options' => array(
                'label' => 'The Text'
            )
        ));

        $fs->add(array(
            'type' => 'text',
            'name' => 'title',
            'options' => array(
                'label' => 'Blog Title'
            )
        ));


        $form=new \Zend\Form\Form('my-form');
        $form->add($fs);
        return new ViewModel(array('form' => $form));

and just " echo $this->form($form)" in the view.

No attribute name for the fieldset is rendered.


Comment

User: @froschdesign
Created On: 2016-04-13T07:48:07Z
Updated At: 2016-04-13T07:48:07Z
Body

I belive name is a valid html attributes for fieldset

It's only allowed in HTML5.


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions