cakephp Basic tutorial for beginners to learn CAKEPHP
Jul 29, 2016 am 08:41 AMCAKEPHP 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. 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!
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!
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!
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!
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!
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!
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.

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

Logging in CakePHP is a very easy task. You just have to use one function. You can log errors, exceptions, user activities, action taken by users, for any background process like cronjob. Logging data in CakePHP is easy. The log() function is provide

Validator can be created by adding the following two lines in the controller.

This chapter deals with the information about the authentication process available in CakePHP.

In this chapter, we are going to learn the following topics related to routing ?

CakePHP is a powerful PHP framework that provides developers with many useful tools and features. One of them is pagination, which helps us divide large amounts of data into several pages, making browsing and manipulation easier. By default, CakePHP provides some basic pagination methods, but sometimes you may need to create some custom pagination methods. This article will show you how to create custom pagination in CakePHP. Step 1: Create a custom pagination class First, we need to create a custom pagination class. this

To work on file upload we are going to use the form helper. Here, is an example for file upload.
