CakePHP2.xCookBook Chinese version Chapter 3 getting started-CakePHP folder structure

Source: Internet
Author: User
After you download and decompress CakePHP, you will have the following file and folder structure: folder structure of CakePHP

After you download and decompress CakePHP, you will have the following file and folder structure:

  • App
  • Lib
  • Vendors
  • Plugins
  • . Htaccess
  • Index. php
  • README

Note the following three main folders:

  • AppFolder is the main place for your work: the application file will be placed here.
  • LibFolder is where we work. You personallyNoEdit the content in this folder. If you edit these core files, we will not provide any help.
  • Finally,VendorsFolder is the place where you need to use a third-party PHP library in your CakePHP application.
App Folder

The app folder of CakePHP is where you program the vast majority of applications. Let's take a closer look at the stuff in the app folder.

Config manages the configuration files used by CakePHP (just a few ). The configuration files of database connection details, such as configuration, user-initiated configuration, and kernel configuration are stored here. The Controller contains the Controller of your application and its components. Lib contains the first library that is not from a third party or external supplier. This allows you to separate your original internal library from the supplier library. Locale stores international string files. The Model contains the Model, behavior, and data source of your application. Plugin contains the plug-in package. Tmp

CakePHP's temporary data. Real data storage depends on how you configure CakePHP, but this folder is usually used to store model descriptions, logs, and sometimes session information.

Make sure the folder exists and is writable. Otherwise, your application will be seriously affected. In debug mode, CakePHP will issue a warning when this occurs.

Third-party classes or libraries of the Vendor are stored here. In this way, you can easily use the App: import ('upload', 'name') function to access this class or library. The sensitive observer will notice that this looks a little redundant, because there is also a vendors folder in our top-level folder structure. The difference between the two is when we release and manage multiple applications and more complex system designs. View files are stored here: Elements, error pages, assistants, la S, and View files. Webroot is installed in a product. This folder serves as the document root directory of the application. These folders are still placed in CSS style sheets, images, or JavaScript files.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.