Symfony2 中的 MASTER/SUB REQUEST 有什么区别? [英] what is the difference between MASTER / SUB REQUEST in Symfony2?
问题描述
所以我正在阅读 symfony2 的内部文档 http://symfony.com/doc/current/book/internals.html 我不明白这部分 http://symfony.com/doc/current/book/internals.html#events.
so im reading the internals documentation for symfony2 http://symfony.com/doc/current/book/internals.html and i dont understand this section http://symfony.com/doc/current/book/internals.html#events.
所以,我想知道 MASTER/SUB REQUEST 之间的区别?
so, i want to know the difference between MASTER / SUB REQUEST ?
推荐答案
master 请求是来自原始用户的请求;子请求是您在内部执行的请求 - 使用 forward()<
方法——或者通过 HttpKernel
的/code>forward()
框架的 Controller
类的帮助器 - 或 {% render ... %}
在 Twig 中.
The master request is the one that comes from the original user; the subrequest is the one that you do internally — either with the forward()
method of HttpKernel
— or by the forward()
helper of the framework's Controller
class — or {% render ... %}
in Twig.
这篇关于Symfony2 中的 MASTER/SUB REQUEST 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!