Skip to content

Commit a5635c3

Browse files
committed
Reword some explanation about bundle structure
1 parent 5064e12 commit a5635c3

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

bundles/best_practices.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,22 @@ The following is the recommended directory structure of an AcmeBlogBundle:
7878
├── LICENSE
7979
└── README.md
8080
81-
This directory structure requires to configure the bundle path to its root
82-
directory as follows::
81+
.. note::
82+
83+
This directory structure is used by default when your bundle class extends
84+
the recommended :class:`Symfony\\Component\\HttpKernel\\Bundle\\AbstractBundle`.
85+
If your bundle extends the :class:`Symfony\\Component\\HttpKernel\\Bundle\\Bundle`
86+
class, you have to override the ``getPath()`` method as follows::
8387

84-
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;
88+
use Symfony\Component\HttpKernel\Bundle\Bundle;
8589

86-
class AcmeBlogBundle extends AbstractBundle
87-
{
88-
public function getPath(): string
90+
class AcmeBlogBundle extends Bundle
8991
{
90-
return \dirname(__DIR__);
92+
public function getPath(): string
93+
{
94+
return \dirname(__DIR__);
95+
}
9196
}
92-
}
9397

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

0 commit comments

Comments
 (0)