The second approach is how I used to do it (coming from Symphony) but I'm curious about something. I'm currently developing a rather large "community" site, and I ended up making the various sections of the site into modules. That is, I've got a forum module for instance, with the following controllers: category, forum, topic and post. Since I'm already using modules in this way, I couldn't create my usual frontend/backend modules, and ended up putting an AdminController in each module (your first approach) which is not ideal, I think.
In a way, by using your second approach, you sacrifice your ability to use modules in the way I described above. What I want to know is: if you were to implement a simple forum on your site using the second approach, would you just put everything in one controller and be done with it? Divide page sections into controllers instead of modules? One advantage that I've discovered with having multiple controllers per "section" is that you get simple action names, for example: TopicController::addAction() which comes in handy when using Zend_Acl, and its inheritance. Oh, and also, you say you have a shared models folder, what about forms? Do you have a shared forms folder as well? (If you're using Zend_Form that is) Cheers Rob Allen-3 wrote: > > > On 4 Apr 2008, at 05:35, Greg Freeman wrote: >> >> What is the best method for creating an admin area for a zend >> framework >> application? > > > I've done it in two ways using modules: > > 1. Each module has an admin controller > 2. Two modules: admin and frontend > > > Going forward, I am going to be using the two separate modules > approach as it's easier to treat the admin as a separate site. One tip > I have is that it's wise to have a models directory outside of the > modules for those models that are common to the application. > > e.g. > > mysite/ > application/ > models/ > modules/ > admin/ > controllers/ > views/ > default/ > controllers/ > views/ > library/ > public/ > /admin > css/ > img/ > js/ > /default/ > css/ > img/ > js/ > > > > Regards, > > Rob... > > -- View this message in context: http://www.nabble.com/Admin-Area-tp16482518p16511821.html Sent from the Zend Framework mailing list archive at Nabble.com.
