536a6cdbd8
This PR was merged into the 3.1-dev branch. Discussion ---------- [3.1] [WebProfilerBundle] [DX] Feature allow forward and redirection detection in wdt | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #14358, #17501 | License | MIT | Doc PR | ? This PR allows to : - track explicit forward from `\Symfony\Bundle\FrameWorkBundle\Controller\Controller` in the web debug toolbar. - or pass a request attribute `_forwarded` with the current request attributes (an instance of `ParameterBag`) as value to your sub request before handling it. - see if you've been redirected (require session enabled) When redirected you will see the name of the route (if any) and a link to the profile of the original request. ![redirect](https://cloud.githubusercontent.com/assets/10107633/12716952/9aacdcba-c8e4-11e5-9a64-d26fe27f1cae.jpg) In case of forwarding, the name of the controller is a file link and next to it there is a direct link to the profile of the sub request. ![forward](https://cloud.githubusercontent.com/assets/10107633/12716968/ba6b1fbc-c8e4-11e5-85fc-7f71969cb372.jpg) This works pretty well in __Silex__ too by registering `SessionServiceProvider()` for redirections or by providing this method for forwarding : ```php class App extends \Silex\Application // (php7 bootstrap) $app = new class extends \Silex\Application { { public function forward($controller, array $path = array(), array $query = array() { if (!$this->booted) { throw new LogicException(sprintf('Method %s must be called from a controller.', __METHOD__)); } $this->flush(); $request = $this['request_stack']->getCurrentRequest(); $path['_forwarded'] = $request->attributes; $path['_controller'] = $controller; $subRequest = $request->duplicate($query, null, $path); return $this['kernel']->handle($subRequest, HttpKernelInterface::SUB_REQUEST); } } ``` Commits ------- |
||
---|---|---|
.composer | ||
.github | ||
src/Symfony | ||
.editorconfig | ||
.gitignore | ||
.php_cs | ||
.travis.php | ||
.travis.yml | ||
appveyor.yml | ||
CHANGELOG-3.0.md | ||
composer.json | ||
CONTRIBUTING.md | ||
CONTRIBUTORS.md | ||
LICENSE | ||
phpunit | ||
phpunit.xml.dist | ||
README.md | ||
UPGRADE-3.0.md | ||
UPGRADE-3.1.md | ||
UPGRADE-4.0.md |
README
What is Symfony?
Symfony is a PHP full-stack web framework. It is written with speed and flexibility in mind. It allows developers to build better and easy to maintain websites with PHP.
Symfony can be used to develop all kind of websites, from your personal blog to high traffic ones like Dailymotion or Yahoo! Answers.
Installation
The best way to install Symfony is to use the official Symfony Installer. It allows you to start a new project based on the version you want.
Documentation
The "Quick Tour" tutorial gives you a first feeling of the framework. If, like us, you think that Symfony can help speed up your development and take the quality of your work to the next level, read the official Symfony documentation.
Contributing
Symfony is an open source, community-driven project. If you'd like to contribute, please read the Contributing Code part of the documentation. If you're submitting a pull request, please follow the guidelines in the Submitting a Patch section and use Pull Request Template.
Running Symfony Tests
Information on how to run the Symfony test suite can be found in the Running Symfony Tests section.