Overloaded element of CForm when trying to follow nested form example

I’ve been following the instructions here for nested forms. The goal is to use a single form to write to several (in my case three) tables/Models. The tables in question are related to each other:

[indent]journal 1–>n editorialInstance n<–1 person[/indent]

In the various associated models, the following relations are also declared (using the proper syntax):

[indent]Journal HAS_MANY EditorialInstance[/indent]

[indent]Person HAS_MANY EditorialInstance[/indent]

[indent]editorialInstance BELONGS_TO Journal[/indent]

[indent]editorialInstance BELONGS_TO Person[/indent]

The problem, once I’ve implemented the nested forms solution is that I get an early “overloaded element” error:

Looking at the code in the documentation, I’m assuming that the controller is supposed to go in the “user” (my “journal”) controller, since the views are all in the user (my “journal”) views directory. But if that’s the case, then I can’t see how to get around this error.

I wondered if maybe I needed to add a dedicated Register Model and RegisterController to deal with the form (at the beginning of the working with form section they discuss creating a model for forms). But when I tried it out I got exactly the same error. The problem seems to be that php doesn’t like any of this


$form['a']->model = new A;

business.