Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在处理的网站的所有页面都将显示一个登录表单。
我想在 layout.php 中显示此表单,以便它出现在任何地方。
我不确定这样做的最佳方法是什么。
我应该使用过滤器吗?
我不认为使用插槽是有效的,因为内容不会在整个站点中更改。
过滤器实际上并没有多大意义——事实上我们已经摆脱了类似的过滤器来处理头脑中的事情,我们不是吗?:-)
插槽是将内容传递给 layout.php 的推荐方式。但是,您可以直接在布局中使用include_partial或include_component分别使用部分和/或组件。
include_partial
include_component