|
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hi,
I have 2 helpers. A helper has a form, and a mapper to handle the database interaction. I pass these helpers to the controller using a controller factory. The controller handles phones and addresses of a party that is either a person or an organization. Because a party is a person or an organization, it has different data, so the controller factory also passes the object: PersonObject or OrganizationObject with the party-specific data into the controller.
The 2 helpers are the same for both party types. But in the view script, I want to show the party-specific data, and here is my problem: I need to change the view script based on the object that the controller factory passes to the controller. I thought of having a two different controllers, but it's an overkill: the view script is 90% the same, except for that 10% party-specific info that comes from the database into the party object.
How to change the view script from the controller factory? By changing here, I mean slightly different html layout with the party specific data.
|