按下回车键跳到正文

ThinkPHP5 study notes

Contents
  1. Install
  2. Development specification

Install

# Install composer:

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

# Update: composer self-update

 

# Using composer install Thinkphp5

composer create-project topthink/think <project name> –prefer-dist

# –prefer-dist: Mandatory use of compressed package, rather than the clone source code

 

Development specification

the Class filename is equal to the Class name, both of those are refer to Namespace

The class file need to be named by the hump method, and the first letter needs to be capitalized. The other files or directories are named under the lowercase or underline.

The class name has the same rules as the class filename

The method is named by using the hump method (first letter lower case)

The function is named by using lowercase letters and underlines(lowercase letters)

The property name is equal to Method name

The magic method consists of a number of uppercase letters that are wrapped with a pair of double underlines

e.g:

Class name: UserType

Method name: getUser

Property name: userName

Function name: str_to_int

Magic function: __PUBLIC__

 

** TO BE CONTINUED **

From LzSkyline's Blog : https://www.lzskyline.com/archives/457

当前没有任何回复哦,快成为第一个吃螃蟹的人~

发表评论

电子邮件地址不会被公开。 必填项已用*标注