cakephp Basic tutorial for beginners to learn CAKEPHP

WBOY
Release: 2016-07-29 08:41:05
Original
1042 people have browsed it

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 meet the requirements of your system Required! If you have time, please go and check out this website! The interface program is easy to develop! Change the template to html format! After modification, it supports both ctp and htm formats!

There are also two systems! They are Symfony and Fleaphp. !Symfony is foreign. Fleaphp is a foreign framework! After selection! I decided to learn and use cakephp!

Let’s understand the structure of cakephp. This is the home directory of cakephp.  初学CAKEPHP 基础教程You can see this app file! Later Everyone writes code in this file. The cake file is a library, a base library! Vendors are also libraries! It is a third-party library! It corresponds to the vendors in the app! .htaccess is a writing rule! There are some regular expressions in it ! Now let me look at the contents of the files under the APP! Let’s take a look at what these files are used for!  初学CAKEPHP 基础教程This is the file under the app. These files are the files that we need to set frequently! Continue to look at these in the config File! 初学CAKEPHP 基础教程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 in it! Open core.php, mainly for us I often make some modifications here!  初学CAKEPHP 基础教程This place! When your program makes an error and cannot detect the error, you use 2. When you are sure there is no error, you can turn off debug and change 2 to 0!  初学CAKEPHP 基础教程This is the save session! There are 3 storage formats for session. The first is to save to the database, which can be set to the server! The second is the PHP file that can be saved to the cake file!  初学CAKEPHP 基础教程 Let’s take a look at this file! Before we download the new cakephp source program After that! 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! Chapter 1 The second mistake is the connection to the database! Then let’s look at how to connect to the database!  初学CAKEPHP 基础教程
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 create a result.html in the layouts folder. If there is an error page, it will display the error page! For example, 404 error! Just write it under the errors folder! Pages are some static pages! Users must To correspond to the actions of controllers, webroot is the root directory! We put uploaded files! What JS files! CSS files! FCKEDITOR all need to be placed in this folder! The components of controllers are where components are placed @that’s us Some components downloaded online!

The above introduces the basic tutorial of CAKEPHP for beginners, including the content of cakephp. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template