Skip to content

Commit e131a5a

Browse files
author
Jules Pietri
committed
Some route fixes left after #11085
1 parent bf1c431 commit e131a5a

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

components/routing.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,14 @@ If you're using the ``YamlFileLoader``, then route definitions look like this:
277277
278278
# routes.yaml
279279
route1:
280-
path: /foo
281-
defaults: { _controller: 'MyController::fooAction' }
280+
path: /foo
281+
controller: MyController::fooAction
282+
methods: GET|HEAD
282283
283284
route2:
284-
path: /foo/bar
285-
defaults: { _controller: 'MyController::foobarAction' }
285+
path: /foo/bar
286+
controller: FooBarInvokableController
287+
methods: PUT
286288
287289
To load this file, you can use the following code. This assumes that your
288290
``routes.yaml`` file is in the same directory as the below code::

routing/hostname_pattern.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,8 @@ You can also set the host option on imported routes:
381381

382382
.. code-block:: php-annotations
383383
384-
// src/Controller/MainController.php
385-
namespace Acme\HelloBundle\Controller;
384+
// vendor/acme/acme-bundle/src/Controller/MainController.php
385+
namespace Acme\AcmeHelloBundle\Controller;
386386
387387
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
388388
use Symfony\Component\Routing\Annotation\Route;

0 commit comments

Comments
 (0)