Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f7d305d

Browse filesBrowse files
javiereguiluzwouterj
authored andcommitted
Added a help note about glob patterns
1 parent 022e2cc commit f7d305d
Copy full SHA for f7d305d

File tree

Expand file treeCollapse file tree

1 file changed

+8
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-2
lines changed

‎service_container.rst

Copy file name to clipboardExpand all lines: service_container.rst
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,9 +843,9 @@ key. For example, the default Symfony configuration contains this:
843843
844844
# the namespace prefix for classes (must end in \)
845845
AppBundle\:
846-
# accepts a glob pattern
846+
# create services for all the classes found in this directory...
847847
resource: '../../src/AppBundle/*'
848-
# exclude some paths
848+
# ...except for the classes located in these directories
849849
exclude: '../../src/AppBundle/{Entity,Repository}'
850850
851851
# 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:
900900
// $this is a reference to the current loader
901901
$this->registerClasses($definition, 'AppBundle\\Controller\\', '../../src/AppBundle/Controller/*');
902902
903+
.. tip::
904+
905+
The value of the ``resource`` and ``exclude`` options can be any valid
906+
`glob pattern`_.
907+
903908
This can be used to quickly make many classes available as services and apply some
904909
default configuration. The ``id`` of each service is its fully-qualified class name.
905910
You can override any service that's imported by using its id (class name) below
@@ -1043,3 +1048,4 @@ Learn more
10431048

10441049
.. _`service-oriented architecture`: https://en.wikipedia.org/wiki/Service-oriented_architecture
10451050
.. _`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

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.