Learn the basics of CAKEPHP

  • 2020-03-31 16:44:36
  • OfStack

CAKEPHP is a system developed by an American team. When you are looking for CAKEPHP materials, GOOGLE them to be more accurate! Or go to the official website to check! The official website is (link: http://www.cakephp.org/)!

  Two more systems! After Symfony and Fleaphp, respectively! Symfony is foreign.Fleaphp is a foreign framework! After the selection! Decide to learn and use cakephp!

  We come to know the structure of cake, the cake is the first directory, < img border = 0 SRC = "http://files.jb51.net/upload/2009-11/20091102214356854.jpg" > you can see the app file! Later you write code is written in this file,cake file is the library, the bottom library! Vendors are libraries too! It's a third-party library! And the vendors inside the app! .htaccess is to write rules! Inside are some regular expressions! Now let me look at the file contents under the APP! Let's take a look at what these files are for! < img border = 0 SRC = "http://files.jb51.net/upload/2009-11/20091102214356189.jpg" > this is below the app files, these files are often set file! Keep looking at these files in config! The < img border = 0 SRC = "http://files.jb51.net/upload/2009-11/20091102214356947.jpg" > general in a SQL database. Open the bootstap.php file! This file allows you to set some constants! Like the skin switch! Multilingual also needs to set the default language here! Open core.php, mainly because we often make some changes here! The < img border = 0 SRC = "http://files.jb51.net/upload/2009-11/20091102214356654.jpg" > this place! When you do not check the program error, you use 2, when you are sure there is no error, you can turn off debug, change 2 to 0! The < img border = 0 SRC = "http://files.jb51.net/upload/2009-11/20091102214356965.jpg" > this is to save the session! Session save format has three, the first is to save to the database, can be set to the server! Then you can save the PHP file in the cake file! < img border = 0 SRC = "http://files.jb51.net/upload/2009-11/20091102214356383.jpg" > let's take a look at this file! After we download the new cakephp source! We found two mistakes! The first one is this file! After we download the new file! Just type some code into that value! As long as the original is not the same as OK! The second error is the connection to the database! So let's look at how the database should be connected! < img border = 0 SRC = "http://files.jb51.net/upload/2009-11/20091102214356455.jpg" >
According to your own Settings to change the database connection! Let's take a look at the views under the app folder. The elements in views are part of a page! The theme of the page needs a result.html in the layouts folder. A 404 error! It's under the errors folder! Pages are static pages! Users must correspond to controllers' action. Webroot is the root! We upload the file ah! What a JS file! CSS files! FCKEDITOR must be placed in this folder! Controllers' components are where the components go @ is some of the components that we have on the web!


Related articles: