Thinkphp_5 Catalogue Introduction and Specification

Source: Internet
Author: User

Introduction to MVC:
Software Design Model
Separation of the three;

Advantage:
Low coupling resistance
High reusability
High maintainability
Facilitates the engineering of software

The transformation of MVC:
Web Development without model mode
Development of API interface without view mode
Model re-layering and controller re-layering

Introduction to the development environment
PHP >=5.4.0
?? PDO mbstring CURL PHP Extension
Mysql >5.5
Apache Nginx

Installation method:

TP directory:
App (app directory)->index (module)->controller (Control layer)
->command.php (Console configuration file) "Execute this configuration with the command line"
->common.php (common file for project) "writes a general function that can be written in this"
->conf ig.php (Applied profile)
->database.php (Database configuration file)
route.php (route file) "to beautify the URL, you can modify this file"
tags.php (apply behavior extension file) "There are many hooks, Can be extended to the framework, without the need to modify the framework itself source code, need to register some functions on a hook or register some behavior, through the behavior to change the framework execution process "
Extend (download third-party library use)
Public (web root) Rebots.txt (search engine crawler file, to search engine)
->router.php (Framework Quick Launch test file)
->static (website static file)
Runtime (cache file in Web site run Log, cache, compile file
thinphp (frame file)->base.php (define some constants)
->composer.json (define composer definition file)
console.php (console Portal file)
->convention.php (framework default profile)
Helper.php (helper function)
Libraiy (CORE)->traits (Extension of class Library)
start.php (box
TPL (framework default template)
vendor (files generated through the composer installation process) "All class libraries installed through composer will be here"

Directory and File Development specifications:
Directories are named using lowercase + underscores
Class Library function filenames are terminated with. php
The file name of the class is defined in the namespace, and the namespace and class library file are in the same path
class file with Hump first letter capitalization the rest of the file is named lowercase + underscore
"Function and class name"
The class name is consistent with the class file name, capitalized with the hump naming first letter
Class uses the hump to name the first letter capitalization does not need to add a suffix
The function uses the hump to name the first letter lowercase such as (getusername)
The property name is in the hump first letter lowercase (tableName)
A function or method that starts with a double underline is a magic method
"Constants and Configurations"
Constants are named with uppercase letters and underscores
Configuration parameters are named with lowercase letters and underscores
"Other Specifications"
Database tables and field names are named with lowercase + underscores that cannot begin with an underscore
Apply class library namespaces uniformly to apps (configurable)

Thinkphp_5 Catalogue Introduction and 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.