Home > Backend Development > PHP Tutorial > 4 Use of Yii20 layout

4 Use of Yii20 layout

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-08-08 09:24:00
Original
1006 people have browsed it

Yii2 has 3 ways to select layout


1. Use

public $layout = false; //不使用布局
public $layout = "main"; //设置使用的布局文件
Copy after login
for the entire controller


2. Use

$this->layout = false; //不使用布局
$this->layout = "main"; //设置使用的布局文件
Copy after login

in the controller member method 3. Select layout in the view
$this->context->layout = false; //不使用布局
$this->context->layout = 'main'; //设置使用的布局文件
Copy after login

The above introduces the use of 4 Yii20 layouts, including aspects of content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
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
Latest Issues
Layout issues
From 1970-01-01 08:00:00
0
0
0
Layout in Next.js obscures page content
From 1970-01-01 08:00:00
0
0
0
html - css layout table cellspacing
From 1970-01-01 08:00:00
0
0
0
css - Flex layout issue
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template