CakePHP – Folder Structure

  1. Home
  2. Knowledge Base
  3. Web Development
  4. CakePHP – Folder Structure

CakePHP – Folder Structure

Take a look at the following screenshot. It shows the folder structure of CakePHP.



The following table describes the role of each folder −

S.No Folder Name & Description
1 bin

The bin folder holds the Cake console executables.

2 config

The config folder holds the (few) configuration files CakePHP uses. Database connection details, bootstrapping, core configuration files and more should be stored here.

3 logs

The logs folder normally contains your log files, depending on your log configuration.

4 plugins

The plugins folder is where the Plugins your application uses are stored.

5 src

The src folder will be where you work your magic: It is where your application’s files will be placed. CakePHP’s src folder is where you will do most of your application development. Let’s look a little closer at the folders inside src.

  • Console Contains the console commands and console tasks for your application.
  • Controller Contains your application’s controllers and their components.
  • Locale Stores string files for internationalization.
  • Model Contains your application’s tables, entities and behaviors.
  • View Presentational classes are placed here: cells, helpers, and template files.
  • Template Presentational files are placed here: elements, error pages, layouts, and view template files.
6 tests

The tests folder will be where you put the test cases for your application.

7 tmp

The tmp folder is where CakePHP stores temporary data. The actual data it stores depends on how you have CakePHP configured, but this folder is usually used to store model descriptions and sometimes session information.

8 vendor

The vendor folder is where CakePHP and other application dependencies will be installed. Make a personal commitment not to edit files in this folder. We can’t help you if you’ve modified the core.

9 webroot

The webroot directory is the public document root of your application. It contains all the files you want to be publically reachable.

Facebook Comments

Was this article helpful?

Related Articles