diff --git a/components/routing/introduction.rst b/components/routing/introduction.rst index 8c4b465bc8c..e57f97e8df5 100644 --- a/components/routing/introduction.rst +++ b/components/routing/introduction.rst @@ -234,11 +234,11 @@ If you're using the ``YamlFileLoader``, then route definitions look like this: # routes.yml route1: pattern: /foo - defaults: { controller: 'MyController::fooAction' } + defaults: { _controller: 'MyController::fooAction' } route2: pattern: /foo/bar - defaults: { controller: 'MyController::foobarAction' } + defaults: { _controller: 'MyController::foobarAction' } To load this file, you can use the following code. This assumes that your ``routes.yml`` file is in the same directory as the below code:: @@ -334,4 +334,4 @@ automatically in the background if you want to use it. A basic example of the are saved in the ``cache_dir``. This means your script must have write permissions for that location. -.. _Packagist: https://packagist.org/packages/symfony/routing \ No newline at end of file +.. _Packagist: https://packagist.org/packages/symfony/routing