Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita499d12

Browse files
committed
minor#6298 Update dependency_injection.rst because it has an error. (joserprieto)
This PR was submitted for the 3.0 branch but it was merged into the 2.8 branch instead (closes#6298).Discussion----------Update dependency_injection.rst because it has an error.The line: $sc->register('listener.router', 'Symfony\Component\HttpKernel\EventListener\RouterListener') ->setArguments(array(new Reference('matcher'))) ;is wrong, because the Symfony\Component\HttpKernel\EventListener\ResponseListener has two mandatory arguments; an instance of Symfony\Component\Routing\Matcher\UrlMatcher (or RequestMatcher), and an instance of RequestStack; so, we need to add the line:$sc->register('request_stack', 'Symfony\Component\HttpFoundation\RequestStack');And change the registration of listener.router on this form: $sc->register('listener.router', 'Symfony\Component\HttpKernel\EventListener\RouterListener') ->setArguments(array(new Reference('matcher'), new Reference('request_stack'))) ;Commits-------06eee41 Update dependency_injection.rst because it has an error.
2 parents3d3bac0 +06eee41 commita499d12

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎create_framework/dependency_injection.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,11 @@ Create a new file to host the dependency injection container configuration::
100100
$sc->register('matcher', 'Symfony\Component\Routing\Matcher\UrlMatcher')
101101
->setArguments(array($routes, new Reference('context')))
102102
;
103+
$sc->register('request_stack', 'Symfony\Component\HttpFoundation\RequestStack');
103104
$sc->register('resolver', 'Symfony\Component\HttpKernel\Controller\ControllerResolver');
104105

105106
$sc->register('listener.router', 'Symfony\Component\HttpKernel\EventListener\RouterListener')
106-
->setArguments(array(new Reference('matcher')))
107+
->setArguments(array(new Reference('matcher'), new Reference('request_stack')))
107108
;
108109
$sc->register('listener.response', 'Symfony\Component\HttpKernel\EventListener\ResponseListener')
109110
->setArguments(array('UTF-8'))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp