开发者

What's the best way to pass a variable to layout.php in Symfony?

开发者 https://www.devze.com 2022-12-18 13:02 出处:网络
All pages of the website I\'m working on will show a signin form. I\'d like to display this form in layout.php so it appears everywhere.

All pages of the website I'm working on will show a signin form.

I'd like to display this form in layout.php so it appears everywhere.

I'm not sure what's the best way to do this.

Should I use a filter?

I don't think using a slot is efficient since content w开发者_如何转开发on't change throughout the site.


A filter doesnt actually make much sense - in fact weve jsut gotten rid of a similar filters for things in the head have we not?? :-)

A slot is the reccommended way to pass things up to layout.php. However you could just use a partial and/or component directly in the layout with include_partial or include_component respectively.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号