CAKEPHP is a system developed by an American team. When looking for CAKEPHP information, search for more accurate information on GOOGLE! Or go to the official website to check! The official website is www.cakephp.org!
First let’s discuss why we should use CAKEPHP! cakephp inherits the advantages of rails! High development efficiency! Easy to maintain! Many components! http://bakery.cakephp.org/categories/view/5 These components are enough to satisfy you System needs! If you have time, please go and check out this website! It is easy to develop interface programs! Change the template to html format! After modification, it supports both ctp and htm formats!
There are two systems! They are Symfony and Fleaphp! Symfony is foreign. Fleaphp is a foreign framework! After choosing! I decided to learn and use cakephp!
Let’s take a look at the structure of cakephp. This is the home directory of cakephp. You can see this app file! In the future, everyone will write code in this file. The cake file is a library, and the bottom library! Vendors are also Library! It’s a third-party library! It corresponds to the vendors in the app! .htaccess is the writing rule! There are some regular expressions in it! Let’s take a look at the file content under the APP! Let’s take a look at these files one by one. What is it used for! This is the file under the app. These files are the files we need to set frequently! Continue to look at these files in the config! The database is usually placed in sql! Open the bootstap.php file! You can set some constants in this file! For example, the skin switching function! Multi-language also needs to set the default language here! Open core.php, mainly because we often make some modifications here! This place! When you When the program fails and no errors are detected, you can use 2. When you are sure that there are no errors, you can turn off debug and change 2 to 0! This is to save the session! There are three saving formats for the session. The first It is saved to the database and can be set to the server! Then there is the PHP file that can be saved to the cake file! Let’s take a look at this file! After we downloaded the new cakephp source program! We found two errors! The first One is this file! After we download the new file! We just need to type some code in the latter value! As long as it is different from the original one, it will be OK! The second error is the database connection! Then we Next, let’s look at how to connect to the database!
Change the database connection according to your own settings! Let’s take a look at the views under the app folder. The elements in views are parts of a page! The theme of the page needs to be in Create a result.html in the layouts folder. If there is an error page, it will display the error page! For example, a 404 error! Just write it under the errors folder! Pages are some static pages! Users must correspond to the actions of controllers. , webroot is the root directory! We put the uploaded files! What JS files! CSS files! FCKEDITOR needs to be placed in this folder! The components of controllers are where components are placed. They are some components we download online. !