Robert Basic: Grouping Zend Framework controllers in subdirectories

A few months ago, Robert Basic wrote about this handy organisational tip:

Thanks to a discussion on the Zend Framework mailing list I learned about a new feature, a feature that allows for grouping action controllers in subdirectories!

He then goes on to explain how he can now group controllers related to admin within a subdirectory of controllers which makes organisation easier:

Best part is that this feature requires no additional configuration. Create a subdirectory under the controllers directory and place the controller file under that subdirectory. In that pretty screenshot image you can see a FooController.php in the directory called Sub; the class name in that example is Sub_FooController and is accessible via the sub_foo/controller URI. The corresponding view files should be placed in views/scripts/sub/foo/ directory.

Posted by Rob on 9th July 2011 under Around the web | 1 Comment »

One Response to “Robert Basic: Grouping Zend Framework controllers in subdirectories”

  1. Franck responded on 10 Jul 2011 at 9:32 am #

    Ok, but what about creating a modular application instead of subdirectories ? Much easier, especially if you want to deal with ACL’s in the case of an Admin access.