ZF-5881: Array notation & view script decorator interoperation


It would be nice if I did not have to explicitly call setElementsBelongTo() on subforms when using a viewscript decorator for rendering the parent form. Once I had my forms working I decided to make one of my forms use a viewscript decorator which broke it, since using the viewscript decorator entails disabling the formElements decorator and since the "default" array notation is handled in the formElements decorator, this seemed awkward to me.

In other words applying the viewScript decorator to a form should not disable array notation on it's children, I would think


Currently, setElementsBelongTo() is automatically called as part of the FormElements decorator. It is not called before this as we then have a chicken/egg problem: if the sub forms are nested, the parent sub form needs to inform the child, and so on.

While it may be awkward, it's also the trade off you have for the flexibility of using ViewScript or your own custom decorators.