Cakephp learning note-case-sensitive, plural

Source: Internet
Author: User
Abstract: I have been learning to use cakephp for some days! But some basic things cannot be written smoothly! Note the frequent errors during the learning process! I hope you will pay attention to it in the course of learning !... I have been learning to use cakephp for some days! But some basic things cannot be written smoothly! Note the frequent errors during the learning process! I hope you will pay attention to it during your learning process!

1. poor English, wrong words, and case sensitive! It is often difficult to find out, so you need to learn more English and remember more words!

For example, Containable cannot be written as containable (uppercase) or containabel (le-> el );

class AppModel extends Model {    var $actsAs = array('Containable');}

2. file names for controllers, models, and views, including uppercase and lowercase letters and singular numbers!

I personally think that in the singular and plural numbers, the names of controllers, data table names, and view folders are all plural; the names of models are singular!

The file name is case-insensitive, but note the underscore! The code is case sensitive!

Controller: File name: received_notes_controller.php

Code:

class ReceivedNotesController extends AppController{    var $name = 'ReceivedNotes';}

Url: http: // 192.168.11.150/cvs06/received_notes (controller name removed from controller)

Model: File name: received_note.php

Code:

class ReceivedNote extends AppModel{    var $name = 'ReceivedNote';}

View: The folder name is in the plural. For example, "users"

Please try cakephp with uppercase and lowercase letters, underscores, and names! Once you are familiar with it, you will be able to learn and develop more smoothly! Good luck!

The above is the content of Cakephp learning note-case-sensitive, single and multiple numbers. For more information, see The PHP Chinese website (www.php1.cn )!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.