Yii2 uses five module layout files

WBOY
Release: 2016-08-08 09:30:39
Original
1034 people have browsed it

Normally, the layout file used by a view is:

/basic/views/layouts/main.php

And we often need to define the view used by a module by ourselves. In this case, we only need to define it in the corresponding controller. Add in php:

public $layout="rbac/rbacadmins.php";
Copy after login

Copy after login
(the default action can also be changed, use public $defaultAction='index';)


At the same time, copy the default layouts/main.php to generate a new layout.php file and place it in the corresponding location:

/basic/views/layouts/rbac/rbacadmins.php

.

The above introduces the use of five module layout files in Yii2, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template