File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -78,16 +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- class AcmeBlogBundle extends Bundle
85- {
86- public function getPath(): string
88+ use Symfony\Component\HttpKernel\ Bundle\Bundle;
89+
90+ class AcmeBlogBundle extends Bundle
8791 {
88- return \dirname(__DIR__);
92+ public function getPath(): string
93+ {
94+ return \dirname(__DIR__);
95+ }
8996 }
90- }
9197
9298**The following files are mandatory **, because they ensure a structure convention
9399that automated tools can rely on:
Original file line number Diff line number Diff line change @@ -75,9 +75,9 @@ method in the extension)::
7575
7676 use App\DependencyInjection\Compiler\CustomPass;
7777 use Symfony\Component\DependencyInjection\ContainerBuilder;
78- use Symfony\Component\HttpKernel\Bundle\Bundle ;
78+ use Symfony\Component\HttpKernel\Bundle\AbstractBundle ;
7979
80- class MyBundle extends Bundle
80+ class MyBundle extends AbstractBundle
8181 {
8282 public function build(ContainerBuilder $container): void
8383 {
You can’t perform that action at this time.
0 commit comments