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:
78
78
├── LICENSE
79
79
└── README.md
80
80
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::
83
87
84
- class AcmeBlogBundle extends Bundle
85
- {
86
- public function getPath(): string
88
+ use Symfony\Component\HttpKernel\ Bundle\Bundle;
89
+
90
+ class AcmeBlogBundle extends Bundle
87
91
{
88
- return \dirname(__DIR__);
92
+ public function getPath(): string
93
+ {
94
+ return \dirname(__DIR__);
95
+ }
89
96
}
90
- }
91
97
92
98
**The following files are mandatory **, because they ensure a structure convention
93
99
that automated tools can rely on:
Original file line number Diff line number Diff line change @@ -75,9 +75,9 @@ method in the extension)::
75
75
76
76
use App\DependencyInjection\Compiler\CustomPass;
77
77
use Symfony\Component\DependencyInjection\ContainerBuilder;
78
- use Symfony\Component\HttpKernel\Bundle\Bundle ;
78
+ use Symfony\Component\HttpKernel\Bundle\AbstractBundle ;
79
79
80
- class MyBundle extends Bundle
80
+ class MyBundle extends AbstractBundle
81
81
{
82
82
public function build(ContainerBuilder $container): void
83
83
{
You can’t perform that action at this time.
0 commit comments