Symfony2 中的 MASTER/SUB REQUEST 有什么区别? [英] what is the difference between MASTER / SUB REQUEST in Symfony2?

查看:21
本文介绍了Symfony2 中的 MASTER/SUB REQUEST 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在阅读 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆