Ghrae wrote:
> 
> I've seen several posts where people have talked about how they have their
> framework laid out.  I see different locations for Admin functions...
> sometimes in the modules they are administering and sometimes in their own
> admin module..
> 

My directory structure is laid out for a default user, administrator user,
and super user:

application
  -- config
  -- controllers
  -- layouts
  -- models
  -- modules
    ---- admin
      ------ controllers
      ------ views
    ---- default
      ------ controllers
      ------ views
    ---- super
      ------ controllers
      ------ views

This setup works well with the Zend_Acl component to limit access to modules
based on their login level.  The admin and super users both have abilities
to edit tables so to eliminate duplicate code I have the CrudController base
class controller in application/controllers and the Admin_CrudController and
Super_CrudController each extend this base class and override the methods
they need.  

I have two questions myself:

  1.) Why does this not work in bootstrap (it has no effect):

    $Zend_Controller_Front::getInstance()
       ->setControllerDirectory(APPLICATION_PATH.'/controllers');

  I find myself having to add it to the include path:

    set_include_path('.'
      . PATH_SEPARATOR . '../library/'
      . PATH_SEPARATOR . '../application/models'
      . PATH_SEPARATOR . '../application/controllers'
      . PATH_SEPARATOR . get_include_path());

  2.) I have duplicate code in my views (and helpers) for each module:
admin, default, super.  Is there a way to have Zend look at some default
views and helpers and if a module wants to override them, then they can be
declared under that module directory.  Something like: application/views.
-- 
View this message in context: 
http://www.nabble.com/Best-Practices-%3A%3A-Admin-Module-tp19543405p19593537.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to