@@ -843,9 +843,9 @@ key. For example, the default Symfony configuration contains this:
843
843
844
844
# the namespace prefix for classes (must end in \)
845
845
AppBundle\ :
846
- # accepts a glob pattern
846
+ # create services for all the classes found in this directory...
847
847
resource : ' ../../src/AppBundle/*'
848
- # exclude some paths
848
+ # ...except for the classes located in these directories
849
849
exclude : ' ../../src/AppBundle/{Entity,Repository}'
850
850
851
851
# these were imported above, but we want to add some extra config
@@ -900,6 +900,11 @@ key. For example, the default Symfony configuration contains this:
900
900
// $this is a reference to the current loader
901
901
$this->registerClasses($definition, 'AppBundle\\Controller\\', '../../src/AppBundle/Controller/*');
902
902
903
+ .. tip ::
904
+
905
+ The value of the ``resource `` and ``exclude `` options can be any valid
906
+ `glob pattern `_.
907
+
903
908
This can be used to quickly make many classes available as services and apply some
904
909
default configuration. The ``id `` of each service is its fully-qualified class name.
905
910
You can override any service that's imported by using its id (class name) below
@@ -1043,3 +1048,4 @@ Learn more
1043
1048
1044
1049
.. _`service-oriented architecture` : https://en.wikipedia.org/wiki/Service-oriented_architecture
1045
1050
.. _`Symfony Standard Edition (version 3.3) services.yml` : https://github.com/symfony/symfony-standard/blob/3.3/app/config/services.yml
1051
+ .. _`glob pattern` : https://en.wikipedia.org/wiki/Glob_(programming)
0 commit comments