@@ -436,16 +436,11 @@ To take advantage of this system, you'll create a ``Configuration`` class
436
436
and build a tree that defines your configuration in that class::
437
437
438
438
// src/Acme/HelloBundle/DependencyExtension/Configuration.php
439
- namespace Acme\HelloBundle\DependenyInjection ;
439
+ namespace Acme\HelloBundle\DependencyInjection ;
440
440
441
441
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
442
442
use Symfony\Component\Config\Definition\ConfigurationInterface;
443
443
444
- /**
445
- * FrameworkExtension configuration structure.
446
- *
447
- * @author Jeremy Mikola <[email protected] >
448
- */
449
444
class Configuration implements ConfigurationInterface
450
445
{
451
446
public function getConfigTreeBuilder()
@@ -458,6 +453,8 @@ and build a tree that defines your configuration in that class::
458
453
->scalarNode('my_type')->defaultValue('bar')->end()
459
454
->end()
460
455
;
456
+
457
+ return $treeBuilder;
461
458
}
462
459
463
460
This is a *very * simple example, but you can now use this class in your ``load() ``
@@ -525,5 +522,10 @@ and return a unique alias named after the bundle (e.g. ``acme_hello``). This
525
522
is required because the class name doesn't follow the standards by ending
526
523
in ``Extension ``.
527
524
525
+ Additionally, the ``load() `` method of your extension will *only * be called
526
+ if the user specifies the ``acme_hello `` alias in at least one configuration
527
+ file. Once again, this is because the Extension class doesn't follow the
528
+ standards set out above, so nothing happens automatically.
529
+
528
530
.. _`FrameworkBundle Configuration` : https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
529
531
.. _`TwigBundle Configuration` : https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php
0 commit comments