Skip to content

Commit

Permalink
Reword some explanation about bundle structure
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed May 10, 2024
1 parent 5064e12 commit a5635c3
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions bundles/best_practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,22 @@ The following is the recommended directory structure of an AcmeBlogBundle:
├── LICENSE
└── README.md
This directory structure requires to configure the bundle path to its root
directory as follows::
.. note::

This directory structure is used by default when your bundle class extends
the recommended :class:`Symfony\\Component\\HttpKernel\\Bundle\\AbstractBundle`.
If your bundle extends the :class:`Symfony\\Component\\HttpKernel\\Bundle\\Bundle`
class, you have to override the ``getPath()`` method as follows::

use Symfony\Component\HttpKernel\Bundle\AbstractBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;

class AcmeBlogBundle extends AbstractBundle
{
public function getPath(): string
class AcmeBlogBundle extends Bundle
{
return \dirname(__DIR__);
public function getPath(): string
{
return \dirname(__DIR__);
}
}
}

**The following files are mandatory**, because they ensure a structure convention
that automated tools can rely on:
Expand Down

0 comments on commit a5635c3

Please sign in to comment.