Home>Article>PHP Framework> What is the difference between 5 and 6 in thinkphp

What is the difference between 5 and 6 in thinkphp

WBOY
WBOY Original
2022-02-18 14:50:32 8334browse

Differences: 1. thinkphp5 defaults to multiple applications, while thinkphp6 defaults to single application; 2. thinkphp5 loads the official template engine by default, but thinkphp6 does not load the official template engine by default; 3. thinkphp5 enables session by default, but thinkphp6 does not by default Enable.

What is the difference between 5 and 6 in thinkphp

The operating environment of this article: Windows 10 system, ThinkPHP version 5, Dell G3 computer.

What is the difference between 5 and 6 in thinkphp

1. Thinkphp5 defaults to multi-application, Thinkphp6 defaults to single application

You need to enable multi-application mode and need to install it separately

Execute the command composer require topthink/think-multi-app

2. Thinkphp5 loads the official template engine by default, Thinkphp6 does not load the official template engine by default

Requires use and needs to be installed separately

Execute the command composer require topthink/think-view

3.Thinkphp5 enables session by default, Thinkphp6 does not enable session by default

Use verification code, the verifier needs to enable session

What is the difference between 5 and 6 in thinkphp

Loading templates, assigning values to templates, and receiving parameters

thinkphp5 can inherit think\Controller

$this->request->param() to receive parameters,

$this->assign() template variable assignment

$this->fetch() load attempt

thinkphp6 no longer has the think\Controller class, you can use it directly The facade class of the corresponding class.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What is the difference between 5 and 6 in thinkphp. For more information, please follow other related articles on the PHP Chinese website!

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