model view controller - Zend Framework :: General App Design Question -


I have just learned that Zend (and oh PHP for that matter), I studied the last 4-5 weeks Have done, tutorials, books etc. I feel good about it, but drown in the model (okay, I'm learning). Now I'm starting my first app (also for work); There are at least 5 major sections (including admission + will require ACL), and a couple will have sub sections up to 10-12 such as Administrator: Create user, edit user, etc.

I create most pageviews with single layout, and working links, and some of these forms are already full

My biggest worry is now that I Before exiting the hand, the modules of the main sections should be reprocessed and made, or I am worried about nothing. One thing I think I have done wrong is that I have a 'AdminController' which does nothing but the administrator is in 'View', which is more than a 'user' action link in the 'User Controller' is not. I am thinking that I should take the user's action in the admin controller. I am also thinking that I should make 'admin' module, 'report' module, audio module etc., or is it normal to end and increase with 8 controllers? I already have a tendency to create and maintain a developer's sitemap which is only for my own discretion, it does not say that I want to do the best thing :)

In theory, I liked the idea of ​​plug-in-enabled modules for each set of functions - news, users, galleries, etc." Plugin "back to that module Provide functionality for A.Adman and Front-End Display is an in-built place for all this functionality - models, caretakers, view colleagues, view scripts etc - that you need for that content area NewsBeckend controller and News_Frontend controller - their specific Dedicated to the areas.

But in practice, I think that ZF modules make that difficult. I know that smarter people than me - for a little time, to make sure - all this can work, but I did not have luck with it.

So I usually end up with two modules - frontend and backend. For news functionality, for example, I have a news controller in backend module for content management; Another news controller in frontend module to display it

In this setup, there is a sticky point for me that putting model performance where both ends and admin are common, one idea is to put it in a separate library and then to create module-specific models These module-specific extensions extend to general news content:

MyLibary_Model_News .

Frontend_Model_News increases myLibrary_Model_News to any front-only-news functionality, if any.

Admin_Model_News extends MyLibrary_Model_News for any backend-only news function, if any.

Just like some thoughts, YMMV

Comments