search
Homephp教程php手册PHP development specifications

PHP development specifications

Sep 19, 2016 am 08:55 AM
PHP development specifications

  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]

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft