Home php教程 php手册 初学CAKEPHP 基础教程

初学CAKEPHP 基础教程

Jun 13, 2016 pm 12:20 PM
cakephp g go team exist Base develop try to find Tutorial yes of system USA material

CAKEPHP是美国团队开发的一个系统,大家在找CAKEPHP资料的时候去GOOGLE搜索的资料精确些!或者去官方网站上去查!官方网址是www.cakephp.org!

   首先我们来讨论一下为什么要用CAKEPHP!cakephp继承了rails的优点!开发效率高!易于维护!组件多!http://bakery.cakephp.org/categories/view/5这些组件足够满足你系统的需要!有时间大家去这个网站上看看!为界面程序易于开发!更改模板为html格式!经过修改后的支持ctp和htm两种格式!

  还有两个系统!分别是Symfony与Fleaphp后!Symfony是国外的.Fleaphp是国外的一个框架!经过选择之后!决定学习并使用cakephp!

  我们来了解一下cakephp的结构,这个是cakephp的首目录,大家可以看到这个app文件!以后大家写代码就写在这个文件里面,cake文件是库,底库!vendors也是库!是第三方库!和app里面的vendors是对应的!.htaccess是冲写规则!在里面是一些正则表达式!下面我来看APP下面的文件内容!我们来一一看下这些文件是做什么用的!这个是app下面的文件,这些文件都是我们要经常设置的文件!继续看config里面的这些文件!数据库一般放在sql里面!打开bootstap.php文件!这个文件你可以设置一些常量!比如说皮肤切换功能!多语言也需要在这里面设置默认的语言!打开core.php,主要是我们经常会在这里做一些修改!这个地方!当你程序出错检查不出错误的时候,你就用2,当你确定没错误的时候,可以关掉debug,改2为0!这个是保存session!session的保存格式有3个,第一是保存到数据库,可以设置到服务器上!再就是可以保存到cake文件中的PHP文件!我们来看这个文件!在我们下载新的cakephp源程序之后!我们户发现两个错误!第一个就是这个文件!在我们下载新的文件的以后!只需要在在后面那个值里面随便敲些代码进去!只要和原来的不一样就OK了!第二个错误就是数据库的连接!那么我们接下来看数据库应该怎么连接!
根据你自己的设置改数据库的连接!我们再来看一下app文件夹下面的views,views中的elements是一个页面的部分!页面的主题需要在layouts这个文件夹里面建一个result.html如果有错误的页面,就是显示错误的页面!比如说404错误!就写在errors这个文件夹下面!pages是一些静态页面!users必须和controllers的action想对应,webroot是根目录!我们把上传的文件啊!什么JS文件啊!CSS文件啊!FCKEDITOR都需放在这个文件夹中去!controllers的components是放组件的地方@就是我们在网上下的一些组件!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1673
14
PHP Tutorial
1277
29
C# Tutorial
1257
24
CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

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

CakePHP Working with Database CakePHP Working with Database Sep 10, 2024 pm 05:25 PM

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

Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time Jul 30, 2024 pm 02:17 PM

On July 29, at the roll-off ceremony of AITO Wenjie's 400,000th new car, Yu Chengdong, Huawei's Managing Director, Chairman of Terminal BG, and Chairman of Smart Car Solutions BU, attended and delivered a speech and announced that Wenjie series models will be launched this year In August, Huawei Qiankun ADS 3.0 version was launched, and it is planned to successively push upgrades from August to September. The Xiangjie S9, which will be released on August 6, will debut Huawei’s ADS3.0 intelligent driving system. With the assistance of lidar, Huawei Qiankun ADS3.0 version will greatly improve its intelligent driving capabilities, have end-to-end integrated capabilities, and adopt a new end-to-end architecture of GOD (general obstacle identification)/PDP (predictive decision-making and control) , providing the NCA function of smart driving from parking space to parking space, and upgrading CAS3.0

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

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

CakePHP Logging CakePHP Logging Sep 10, 2024 pm 05:26 PM

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

In summer, you must try shooting a rainbow In summer, you must try shooting a rainbow Jul 21, 2024 pm 05:16 PM

After rain in summer, you can often see a beautiful and magical special weather scene - rainbow. This is also a rare scene that can be encountered in photography, and it is very photogenic. There are several conditions for a rainbow to appear: first, there are enough water droplets in the air, and second, the sun shines at a low angle. Therefore, it is easiest to see a rainbow in the afternoon after the rain has cleared up. However, the formation of a rainbow is greatly affected by weather, light and other conditions, so it generally only lasts for a short period of time, and the best viewing and shooting time is even shorter. So when you encounter a rainbow, how can you properly record it and photograph it with quality? 1. Look for rainbows. In addition to the conditions mentioned above, rainbows usually appear in the direction of sunlight, that is, if the sun shines from west to east, rainbows are more likely to appear in the east.

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

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

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

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

See all articles