8000 Update routing.rst by nemoneph · Pull Request #7272 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Update routing.rst #7272

8000 New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions components/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ your autoloader to load the Routing component::
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\Route;

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

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

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

.. note::

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

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

$parameters = $matcher->match('/archive/2012-01');
// array(
// 'controller' => 'showArchive',
// '_controller' => 'showArchive',
// 'month' => '2012-01',
// 'subdomain' => 'www',
// '_route' => ...
Expand Down Expand Up @@ -279,7 +279,7 @@ have to provide the name of a PHP file which returns a :class:`Symfony\\Componen
$collection = new RouteCollection();
$collection->add(
'route_name',
new Route('/foo', array('controller' => 'ExampleController'))
new Route('/foo', array('_controller' => 'ExampleController'))
);
// ...

Expand Down
0