From e97bd8c4efa7e80384fa40088e63d39c4b4bced5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 27 May 2025 11:59:29 +0200 Subject: [PATCH] doc for creating a new bundle: add route --- .../development/create-a-new-bundle.rst | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/source/development/create-a-new-bundle.rst b/docs/source/development/create-a-new-bundle.rst index 61eda87bd..8206acee8 100644 --- a/docs/source/development/create-a-new-bundle.rst +++ b/docs/source/development/create-a-new-bundle.rst @@ -20,7 +20,8 @@ Create a new directory with Bundle class .. code-block:: bash - mkdir -p src/Bundle/ChillSomeBundle/src + mkdir -p src/Bundle/ChillSomeBundle/src/config + mkdir -p src/Bundle/ChillSomeBundle/src/Controller Add a bundle file @@ -43,6 +44,14 @@ Add a bundle file class ChillSomeBundle extends Bundle {} +And a route file: + +.. code-block:: yaml + + chill_ticket_controller: + resource: '@ChillTicketBundle/Controller/' + type: annotation + Register the new psr-4 namespace -------------------------------- @@ -65,8 +74,16 @@ Register the bundle Register in the file :code:`config/bundles.php`: .. code-block:: php + Vendor\Bundle\YourBundle\YourBundle::class => ['all' => true], +And import routes in :code:`config/routes/chill_some_bundle.yaml`: + +.. code-block:: yaml + + chill_ticket_bundle: + resource: '@ChillSomeBundle/config/routes.yaml' + Add the doctrine_migration namespace ------------------------------------