File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,36 @@ their priorities:
76
76
77
77
$ php bin/console debug:event-dispatcher kernel.controller
78
78
79
+ ``kernel.controller_arguments ``
80
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
81
+
82
+ **Event Class **: :class: `Symfony\\ Component\\ HttpKernel\\ Event\\ FilterControllerArgumentsEvent `
83
+
84
+ This event is dispatched just before a controller is called. It's useful to
85
+ configure the arguments that are going to be passed to the controller.
86
+ Typically, this is used to map URL routing parameters to their corresponding
87
+ named arguments; or pass the current request when the ``Request `` type-hint is
88
+ found::
89
+
90
+ public function onKernelControllerArguments(FilterControllerArgumentsEvent $event)
91
+ {
92
+ // ...
93
+
94
+ // get controller and request arguments
95
+ $namedArguments = $event->getRequest()->attributes->all();
96
+ $controllerArguments = $event->getArguments();
97
+
98
+ // set the controller arguments to modify the original arguments or add new ones
99
+ $event->setArguments($newArguments);
100
+ }
101
+
102
+ Execute this command to find out which listeners are registered for this event and
103
+ their priorities:
104
+
105
+ .. code-block :: terminal
106
+
107
+ $ php bin/console debug:event-dispatcher kernel.controller_arguments
108
+
79
109
``kernel.view ``
80
110
~~~~~~~~~~~~~~~
81
111
You can’t perform that action at this time.
0 commit comments