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.

Form/Fieldset messy and not interchangeable #192

Open
@scroach

Description

@scroach

Since I did not get any response in the slack channel and couldn't find anything related:

Currently Zend Form and Fieldset seem like a huge mess to me.

In most of our projects we extendes the Form class to make our form generation easier and faster. And since Form extends Fieldset I thought they were kinda exchangeable in terms of nested forms/fieldsets - but as it seems they are not.

Now I tried to compose multiple Forms into a bigger one with collections trying to carve the code out of this doc: https://framework.zend.com/manual/2.4/en/modules/zend.form.collections.html

This didn't work (due to several reasons?). The collection has never been hydrated. After lots and lots of frustration I found out that using Forms inside other Forms (instead of Fieldset inside Form) seemed to be the problem. This is kinda weird for me, since Form extends Fieldset I automatically assumed I could nest Forms in Forms too - but instead of giving me an error it just does not work!

One of the main problems seems to be the difference in bindValues in both.

  1. Why does Form NOT return $this->object; ? Fieldset does
  2. Why does Form not foreach over all it's children like Fieldset does?

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