File tree Expand file tree Collapse file tree 4 files changed +10
-3
lines changed
Loader/Configurator/Traits Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ final public function methods(array $methods): self
126
126
/**
127
127
* Adds the "_controller" entry to defaults.
128
128
*
129
- * @param callable|string $controller a callable or parseable pseudo-callable
129
+ * @param callable|string|array $controller a callable or parseable pseudo-callable
130
130
*
131
131
* @return $this
132
132
*/
Original file line number Diff line number Diff line change 10
10
->options (['utf8 ' => true ])
11
11
->add ('buz ' , 'zub ' )
12
12
->controller ('foo:act ' )
13
- ->stateless (true );
13
+ ->stateless (true )
14
+ ->add ('controller_class ' , '/controller ' )
15
+ ->controller (['Acme\MyApp\MyController ' , 'myAction ' ]);
14
16
15
17
$ routes ->import ('php_dsl_sub.php ' )
16
18
->prefix ('/sub ' )
Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ public function __invoke(RoutingConfigurator $routes)
12
12
->options (['utf8 ' => true ])
13
13
->add ('buz ' , 'zub ' )
14
14
->controller ('foo:act ' )
15
- ->stateless (true );
15
+ ->stateless (true )
16
+ ->add ('controller_class ' , '/controller ' )
17
+ ->controller (['Acme\MyApp\MyController ' , 'myAction ' ]);
16
18
17
19
$ routes ->import ('php_dsl_sub.php ' )
18
20
->prefix ('/sub ' )
Original file line number Diff line number Diff line change @@ -177,6 +177,9 @@ public function testRoutingConfigurator()
177
177
$ expectedCollection ->add ('buz ' , (new Route ('/zub ' ))
178
178
->setDefaults (['_controller ' => 'foo:act ' , '_stateless ' => true ])
179
179
);
180
+ $ expectedCollection ->add ('controller_class ' , (new Route ('/controller ' ))
181
+ ->setDefaults (['_controller ' => ['Acme\MyApp\MyController ' , 'myAction ' ]])
182
+ );
180
183
$ expectedCollection ->add ('c_root ' , (new Route ('/sub/pub/ ' ))
181
184
->setRequirements (['id ' => '\d+ ' ])
182
185
);
You can’t perform that action at this time.
0 commit comments