Search code examples
phpcakephpcakephp-2.0directory-structure

Split directories in the MVC cakephp


I got a simple question and can't find the answer to it on the web.

Im using the framework CakePHP.

My question is: Is it possible to split my model, controller and view directories. Like this;

  • Controller
    • CMS
      • [controller files of the cms]
    • Front-end
      • [controller files of the front-end]
  • Model
    • CMS
      • [model files of the cms]
    • Front-end
      • [model files of the front-end]
  • View
    • CMS
      • [view files of the cms]
    • Front-end
      • [view files of the front-end]

I really hope somebody can help me, because i have searched in the document 2.x Cakephp and search it all over the web and i cant find a solution for it.

Thank you very much


Solution

  • Not as such, but you can have two different app directories (because you are essentially creating two different applications).

    • CMS
      • Controller
      • Model
      • View
      • ...
    • Frontend
      • Controller
      • Model
      • View
      • ...

    You can set up both apps to use the same webroot directory.