I have an admin login page that I want to render without the layout. How can I render a view in Yii2 without rendering the main layout?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
You can use
renderPartial
to exclude header and footer of layout from view file. However if yourenderPartial
it will not load asset files (css and js files). To load asset files without layout you can userenderAjax
.In your controller you can assing layout for all actions of controller or turn it off:
OR you can do it for only one action:
This can be done using
renderPartial()
method.You can get more from the official documentation. Here's a link!