@@ -175,7 +175,7 @@ of your bundle's configuration.
175
175
176
176
The ``Configuration `` class to handle the sample configuration looks like::
177
177
178
- // src/Acme/SocialBundle/ DependencyInjection/Configuration.php
178
+ // src/DependencyInjection/Configuration.php
179
179
namespace Acme\SocialBundle\DependencyInjection;
180
180
181
181
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
@@ -216,7 +216,7 @@ This class can now be used in your ``load()`` method to merge configurations and
216
216
force validation (e.g. if an additional option was passed, an exception will be
217
217
thrown)::
218
218
219
- // src/Acme/SocialBundle/ DependencyInjection/AcmeSocialExtension.php
219
+ // src/DependencyInjection/AcmeSocialExtension.php
220
220
public function load(array $configs, ContainerBuilder $container): void
221
221
{
222
222
$configuration = new Configuration();
@@ -236,7 +236,7 @@ For example, imagine your bundle has the following example config:
236
236
237
237
.. code-block :: xml
238
238
239
- <!-- src/Acme/SocialBundle/Resources/ config/services.xml -->
239
+ <!-- src/config/services.xml -->
240
240
<?xml version =" 1.0" encoding =" UTF-8" ?>
241
241
<container xmlns =" http://symfony.com/schema/dic/services"
242
242
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
@@ -253,8 +253,8 @@ For example, imagine your bundle has the following example config:
253
253
254
254
In your extension, you can load this and dynamically set its arguments::
255
255
256
- // src/Acme/SocialBundle/ DependencyInjection/AcmeSocialExtension.php
257
- // ...
256
+ // src/DependencyInjection/AcmeSocialExtension.php
257
+ namespace Acme\SocialBundle\DependencyInjection;
258
258
259
259
use Symfony\Component\Config\FileLocator;
260
260
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
@@ -279,7 +279,7 @@ In your extension, you can load this and dynamically set its arguments::
279
279
:class: `Symfony\\ Component\\ HttpKernel\\ DependencyInjection\\ ConfigurableExtension `
280
280
to do this automatically for you::
281
281
282
- // src/Acme/HelloBundle/ DependencyInjection/AcmeHelloExtension.php
282
+ // src/DependencyInjection/AcmeHelloExtension.php
283
283
namespace Acme\HelloBundle\DependencyInjection;
284
284
285
285
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -375,6 +375,7 @@ logic to the bundle class directly::
375
375
configuration definition from one or more files::
376
376
377
377
// src/AcmeSocialBundle.php
378
+ namespace Acme\SocialBundle;
378
379
379
380
// ...
380
381
class AcmeSocialBundle extends AbstractBundle
@@ -417,7 +418,7 @@ The ``config:dump-reference`` command dumps the default configuration of a
417
418
bundle in the console using the Yaml format.
418
419
419
420
As long as your bundle's configuration is located in the standard location
420
- (``YourBundle\ DependencyInjection\ Configuration ``) and does not have
421
+ (``< YourBundle>/src/ DependencyInjection/ Configuration ``) and does not have
421
422
a constructor, it will work automatically. If you
422
423
have something different, your ``Extension `` class must override the
423
424
:method: `Extension::getConfiguration() <Symfony\\ Component\\ DependencyInjection\\ Extension\\ Extension::getConfiguration> `
@@ -451,7 +452,8 @@ URL nor does it need to exist). By default, the namespace for a bundle is
451
452
``http://example.org/schema/dic/DI_ALIAS ``, where ``DI_ALIAS `` is the DI alias of
452
453
the extension. You might want to change this to a more professional URL::
453
454
454
- // src/Acme/HelloBundle/DependencyInjection/AcmeHelloExtension.php
455
+ // src/DependencyInjection/AcmeHelloExtension.php
456
+ namespace Acme\HelloBundle\DependencyInjection;
455
457
456
458
// ...
457
459
class AcmeHelloExtension extends Extension
@@ -480,10 +482,11 @@ namespace is then replaced with the XSD validation base path returned from
480
482
method. This namespace is then followed by the rest of the path from the base
481
483
path to the file itself.
482
484
483
- By convention, the XSD file lives in the ``Resources/ config/schema/ ``, but you
485
+ By convention, the XSD file lives in the ``config/schema/ ``, but you
484
486
can place it anywhere you like. You should return this path as the base path::
485
487
486
- // src/Acme/HelloBundle/DependencyInjection/AcmeHelloExtension.php
488
+ // src/DependencyInjection/AcmeHelloExtension.php
489
+ namespace Acme\HelloBundle\DependencyInjection;
487
490
488
491
// ...
489
492
class AcmeHelloExtension extends Extension
@@ -492,7 +495,7 @@ can place it anywhere you like. You should return this path as the base path::
492
495
493
496
public function getXsdValidationBasePath(): string
494
497
{
495
- return __DIR__.'/../Resources/ config/schema';
498
+ return __DIR__.'/../config/schema';
496
499
}
497
500
}
498
501
0 commit comments