convert content to markdown

This commit is contained in:
2025-12-05 17:11:23 +01:00
parent d16de04d27
commit e82cee2ce1

View File

@@ -1,32 +1,23 @@
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
# Create a new bundle {#create-new-bundle}
.. _create-new-bundle:
Create a new bundle
*******************
.. warning::
:::: warning
::: title
Warning
:::
This part of the doc is not yet tested
::::
Create a new directory with Bundle class
----------------------------------------
.. code-block:: bash
## Create a new directory with Bundle class
``` bash
mkdir -p src/Bundle/ChillSomeBundle/src/config
mkdir -p src/Bundle/ChillSomeBundle/src/Controller
```
Add a bundle file
.. code-block:: php
``` php
<?php
declare(strict_types=1);
@@ -43,22 +34,21 @@ Add a bundle file
use Symfony\Component\HttpKernel\Bundle\Bundle;
class ChillSomeBundle extends Bundle {}
```
And a route file:
.. code-block:: yaml
``` yaml
chill_ticket_controller:
resource: '@ChillTicketBundle/Controller/'
type: annotation
```
Register the new psr-4 namespace
--------------------------------
## Register the new psr-4 namespace
In composer.json, add the new psr4 namespace
.. code-block:: diff
``` diff
{
"autoload": {
"psr-4": {
@@ -66,39 +56,35 @@ In composer.json, add the new psr4 namespace
}
}
}
```
## Register the bundle
Register the bundle
-------------------
Register in the file :code:`config/bundles.php`:
.. code-block:: php
Register in the file `config/bundles.php`:
``` php
Vendor\Bundle\YourBundle\YourBundle::class => ['all' => true],
```
And import routes in :code:`config/routes/chill_some_bundle.yaml`:
.. code-block:: yaml
And import routes in `config/routes/chill_some_bundle.yaml`:
``` yaml
chill_ticket_bundle:
resource: '@ChillSomeBundle/config/routes.yaml'
```
Add the doctrine_migration namespace
------------------------------------
## Add the doctrine_migration namespace
Add the namespace to :code:`config/packages/doctrine_migrations_chill.yaml`
.. code-block:: diff
Add the namespace to `config/packages/doctrine_migrations_chill.yaml`
``` diff
doctrine_migrations:
migrations_paths:
+ 'Chill\Some\Ticket': '@ChillSomeBundle/migrations'
```
Dump autoloading
----------------
.. code-block:: bash
## Dump autoloading
``` bash
symfony composer dump-autoload
```