Hi, On 5/16/07, Greg Freeman <[EMAIL PROTECTED]> wrote:
I was wondering if some people could give me some tips on how to implement an admin section in the Zend Framework, should I just make it a module? or should I create a separate controller. I was leaning towards the module solution.
We are doing most of the administration "in-line", which means that if the user is logged in, they get to do everything where it's appropriate. For example, say you have an entry in a blog, the user edits and deletes basically in the "viewAction". (Did I mention that we use a lot of jQuery?) The actions needed are implemented in the same controller - with appropriate checks of course.
Also with the plugin system is there a way to globally attach a header and a footer to all views so they don't have to be included in every view file?
What we did is this, we basically always use a "main" view. Which expects a $subview variable. So before I attach it to the response: $view = $this->getView(); $view->subtemplate = 'template/action/whatever.php'; ... So my main view holds header and footer, and the subtemplate is loaded into it.
And finally where should the website navigation menu go. The menu items will come from a database.
IMO, the data (menu items) should come from your model. And then you assign them to your view like everything else. If you need them everywhere, you can/should probably make use of preDispatch() (inside your controller) to assign them. Cheers, Till
