Home > php教程 > php手册 > body text

PHP development specifications

WBOY
Release: 2016-09-19 08:55:14
Original
1063 people have browsed it
  1. Directories and (not class files) are both lowercase + underscore, and start with a lowercase letter;

For example: /application/uctenter/controller

  1. 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 "__"
}
}

  1. Function naming | Configuration naming | Data table and field naming, all lowercase + underline;

Such as: get_user()|url_route_on|wll_user

  1. 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]

Related labels:
source:php.cn
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template