Because Cake doesn't follow the Zend/PEAR class naming convention, the
only way to make subfolders work, really, is by manually adding each
subfolder's path with App::build. Because class and file names don't
match up and don't follow a pattern, there's no 'regular' Cake class
name/path and hence no way for the core to know if you're adding
subfolders.

To be honest I'd love it if the Cake classes followed the Zend
convention and used underlines in class names to represents
subfolders. Then instead of having a "controllers/
users_controller.php" file for the UsersController class, we'd have
"controller/users.php" with the "Controller_Users" class. Then
subfolders would be a kick in the pants - "controller/user/group.php"
for Controller_User_Group, etc. But that's just my wishful
thinking. ;)

- Jamie

On Apr 29, 7:38 am, Matthew <ghostofagoodth...@gmail.com> wrote:
> Here is my basic file structure
>
> app/controllers ->
>                      /categories/categories_controller.php
>                      /news/news_controller.php
>                      /users/users_controller.php
>
> First attempt (default controller paths):
> $controllerClasses = App::objects('controller');
> debug($controllerClasses);
>
> Result:
> Array
> (
>     [0] => Pages
>     [1] => App
> )
>
> (These are found in cake/libs/controller)
>
> Second attempt (passing controller paths):
>
> $App =& App::getInstance();
> $paths = $App->controllers;
> debug($paths);
>
> $controllerClasses = $App->objects('controller',$paths);
> debug($controllerClasses);
>
> Result:
> Array
> (
>     [0] => /home/pokey/public_html/cakephp/app/controllers/
>     [1] => /home/pokey/public_html/cakephp/app/
>     [2] => /home/pokey/public_html/cakephp/cake/libs/controller/
> )
>
> Array
> (
>     [0] => Pages
>     [1] => App
> )
>
> It doesn't appear to be finding controllers recursively which doesn't
> make sense because they are supposed to be in sub-folders.
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to