Hi Shawn,

Thanks for your comment (also on SO)! I understand your logic, but the origin 
of my problem is I have a Blog module, Portfolio module, Contact module etc. 
I'd like a loose coupling between these "content" modules and the Admin 
module. So the admin acts like a front controller to fetch editable data from 
the content modules and pass them back to save it again.

In fact, I need an interface to communicate between them. I can use solely 
models for that purpose, but the Blog_Model_Admin_Form needs to be in control 
of saving, sanitizing, fetching data. That doesn't seem a role for a model to 
me.

Your idea seems a good suggestion, but I think it cannot completely fit on my 
use case (because of the controller-like actions need to be done by a model).

Regards, Jurian
-- 
Jurian Sluiman
Soflomo - http://soflomo.com

On Friday 14 Jan 2011 22:04:13 Shawn Ostler wrote:
> I believe you are confusing MVC modules and what you are calling "Page
> Modules". It sounds like you need one module and a few models.
> 
> Pages_Model_Page has many Pages_Model_Module.
> 
> Each, Pages_Model_Module, has one form (Pages_Form_Module_*) and getForm()
> method to get the form for the module. In the getForm() you can create a
> new instance of the "Module" form and fill it will the data for the
> "Module".
> 
> Per "Page", get the "Modules", put each form, as a sub-form, in a standard
> Zend_Form and then pass to View. Upon submission, repeat above to build
> form, then validate. If valid, loop through each module and apply changes.
> 
> With this approach you have one model and form for each "Page Module"
> (text,image,form,rss,video) and when you need a new one, you just create a
> model and form.
> 
> 
> Need further info, let me know.

Reply via email to