CakePHP Learning Small-case, single plural

Source: Internet
Author: User
Get in touch with cakephp and learn to use it, and some days too! But even some of the most basic things can not be successfully written out! In this also the learning process often occurred in the wrong place to remember! Hope that everyone in the process of learning, can attract attention!

1. English is not good, the word is wrong, and pay attention to the case! Often not easy to find, so we have to learn more English, more memory words!

For example: Containable can not be written as containable (initial capitalization) and Containabel (Le->el);

Class Appmodel extends Model {    var $actsAs = array (' containable ');}

2. About the controller, model and view file naming, case and singular plural and so on!

Personally, in a single complex, the controller, the data table name, the folder name of the view is a complex number, the model is named singular!

The file name is not case-sensitive, but please note the underscore (_) this stuff! The code is case-sensitive!

Controller: File name: received_notes_controller.php

The code is:

Class Receivednotescontroller extends appcontroller{    var $name = ' receivednotes ';}

Url:http://192.168.11.150/cvs06/received_notes (Controller name removed controllers section)

Model: File name: received_note.php

The code is:

Class Receivednote extends appmodel{    var $name = ' Receivednote ';}

View: The folder name is plural. such as: "Users"

Please have a more experience under cakephp in the case, underline, name! Once familiar, will make oneself in the study and development more smoothly! Good luck!

The above is cakephp learning small-case, single-plural content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • Related Article

    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.