PHP Development Specification

Source: Internet
Author: User

    1. The directory and (not the class file) are lowercase + underlined and start with lowercase letters;

such as:/application/uctenter/controller

    1. The class name and the class file capitalize the first letter, the name remains the same;

such as:/application/uctenter/controller/user.php

Class user{
Property
Public userName; Hump name First Letter lowercase
Private properties
Private _userage; Hump name First Letter lowercase
Method
Public Function GetUser () {//hump naming initials lowercase
}
Magic method
function __autoload () {//Double underline "__" starts
}
}

    1. Naming of Functions | configuration naming | data table and field naming, full lowercase + underline;

such as: Get_user () |url_route_on|wll_user

    1. Constants name uppercase letters and underscores, for example: App_debug and App_mode;

5. Css uses the bootstrap naming specification , the custom style is : Current page + Location + function [ eg:index_left_news]

PHP Development Specification

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.