在 Yii2 中,如何从视图文件中的渲染中排除布局? [英] In Yii2, how can I exclude layout from rendering in a view file?
本文介绍了在 Yii2 中,如何从视图文件中的渲染中排除布局?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个管理员登录页面,我想在没有布局的情况下呈现该页面.如何在不渲染主布局的情况下在 Yii2 中渲染视图?
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?
推荐答案
这可以使用 renderPartial()
方法完成.
This can be done using renderPartial()
method.
您可以从官方文档中获取更多信息.这是一个链接!
You can get more from the official documentation. Here's a link!
这篇关于在 Yii2 中,如何从视图文件中的渲染中排除布局?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文