- Directories and (not class files) are both lowercase + underscore, and start with a lowercase letter;
For example: /application/uctenter/controller
- The first letter of the class name and the class file should be capitalized, and the names should be consistent;
For example: /application/uctenter/controller/User.php
class User{
//Attribute
public userName; //The first letter of the camel case name is lowercase
//Private attribute
private _userAge; //The first letter of the camel case name is lowercase
//Method
public function getUser(){//The camel case name The first letter is lowercase
}
//Magic method
function __autoload(){//Start with a double underscore "__"
}
}
- Function naming | Configuration naming | Data table and field naming, all lowercase + underline;
Such as: get_user()|url_route_on|wll_user
- Constant names are capital letters and underscores, for example: APP_DEBUG and APP_MODE;
5. Css adopts bootstrap naming convention , custom style is : current page+ position+ function [such as: index_left_news]
Statement: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