doc for creating a new bundle: add route

This commit is contained in:
Julien Fastré 2025-05-27 11:59:29 +02:00
parent e28d7df533
commit e97bd8c4ef
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -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
------------------------------------