CakePHP Folder Structure
The bin folder holds the Cake console executables.
The config folder holds the Configuration filesCakePHP uses. Database connection details, bootstrapping, core configuration filesand more should be stored here.
The plugins folder is where the your application uses are stored.
The src folder will be where your application’s source files will be placed.
The tests folder will be where you put the test cases for your application.
The tmp folder is where CakePHP stores temporary data. The actual data itstores depends on how you have CakePHP configured, but this folderis usually used to store translation messages, model descriptions and sometimessession information.
The webroot directory is the public document root of your application. Itcontains all the files you want to be publicly reachable.
Make sure that the tmp and logs folders exist and are writable,otherwise the performance of your application will be severelyimpacted. In debug mode, CakePHP will warn you, if these directories are notwritable.
CakePHP’s src folder is where you will do most of your applicationdevelopment. Let’s look a little closer at the folders insidesrc.
- Command
- Contains your application’s console commands. SeeConsole Commands to learn more.
- Console
- Contains the installation script executed by Composer.
- Controller
- Contains your application’s and their components.
- Locale
- Middleware
- Stores any Middleware for your application.
- Model
- Contains your application’s tables, entities and behaviors.
- Shell
- Contains shell tasks for your application.For more information see .
- Template
- Presentational files are placed here: elements, error pages,layouts, and view template files.
- Presentational classes are placed here: views, cells, helpers.
The folders and Locale
are not there by default.You can add them when you need them.