Skip to content

Commit 630da14

Browse files
committed
minor #7272 Update routing.rst (nemoneph)
This PR was submitted for the 3.2 branch but it was merged into the 2.7 branch instead (closes #7272). Discussion ---------- Update routing.rst Should use the special key "_controller" instead of "controller". Commits ------- 3eb5858 Update routing.rst
2 parents 2e7eff0 + 3eb5858 commit 630da14

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

components/routing.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ your autoloader to load the Routing component::
3535
use Symfony\Component\Routing\RouteCollection;
3636
use Symfony\Component\Routing\Route;
3737

38-
$route = new Route('/foo', array('controller' => 'MyController'));
38+
$route = new Route('/foo', array('_controller' => 'MyController'));
3939
$routes = new RouteCollection();
4040
$routes->add('route_name', $route);
4141

@@ -44,7 +44,7 @@ your autoloader to load the Routing component::
4444
$matcher = new UrlMatcher($routes, $context);
4545

4646
$parameters = $matcher->match('/foo');
47-
// array('controller' => 'MyController', '_route' => 'route_name')
47+
// array('_controller' => 'MyController', '_route' => 'route_name')
4848

4949
.. note::
5050

@@ -102,7 +102,7 @@ Take the following route, which combines several of these ideas::
102102

103103
$route = new Route(
104104
'/archive/{month}', // path
105-
array('controller' => 'showArchive'), // default values
105+
array('_controller' => 'showArchive'), // default values
106106
array('month' => '[0-9]{4}-[0-9]{2}', 'subdomain' => 'www|m'), // requirements
107107
array(), // options
108108
'{subdomain}.example.com', // host
@@ -114,7 +114,7 @@ Take the following route, which combines several of these ideas::
114114

115115
$parameters = $matcher->match('/archive/2012-01');
116116
// array(
117-
// 'controller' => 'showArchive',
117+
// '_controller' => 'showArchive',
118118
// 'month' => '2012-01',
119119
// 'subdomain' => 'www',
120120
// '_route' => ...
@@ -279,7 +279,7 @@ have to provide the name of a PHP file which returns a :class:`Symfony\\Componen
279279
$collection = new RouteCollection();
280280
$collection->add(
281281
'route_name',
282-
new Route('/foo', array('controller' => 'ExampleController'))
282+
new Route('/foo', array('_controller' => 'ExampleController'))
283283
);
284284
// ...
285285

0 commit comments

Comments
 (0)