CakePHP: Organize Controllers in Subfolders

Is it possible in CakePHP to organize controllers (and models) in subfolders? Thank.

+5
source share
4 answers

Yes you can, but it's out of date. See discussion here . The last post on this page describes how to do this in bootstrap.

+3
source

It is not outdated at all. You can accomplish this using the App: build and point to your subfolders. For example, if you want to put all your Twitter models in Model / Twitter to save your code, you can add the following to bootstrap.php:

App::build(array(
    'Model' => array(APP . 'Model' . DS . 'Twitter' . DS),
));

Now any model file that you put on Model / Twitter will be available when you name it.

: http://book.cakephp.org/2.0/en/core-utility-libraries/app.html#App::build

+8

All Articles