Skip to content

Commit b72be48

Browse files
committed
Merge branch '4.2'
* 4.2: Update best_practices.rst
2 parents e6d2b7b + 737cc7f commit b72be48

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bundles/best_practices.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,12 @@ The ``composer.json`` file should include at least the following metadata:
517517

518518
``autoload``
519519
This information is used by Symfony to load the classes of the bundle. It's
520-
recommended to use the `PSR-4`_ autoload standard.
520+
recommended to use the `PSR-4`_ autoload standard: use the namespace as key,
521+
and the location of the bundle's main class (relative to ``composer.json``)
522+
as value. For example, if the main class is located in the bundle root
523+
directory: ``"autoload": { "psr-4": { "SomeVendor\\BlogBundle\\": "" } }``.
524+
If the main class is located in the ``src/`` directory of the bundle:
525+
``"autoload": { "psr-4": { "SomeVendor\\BlogBundle\\": "src/" } }``.
521526

522527
In order to make it easier for developers to find your bundle, register it on
523528
`Packagist`_, the official repository for Composer packages.

0 commit comments

Comments
 (0)