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";
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.