Skip to content

Commit 970c26d

Browse files
ThomasLandauerjaviereguiluz
authored andcommitted
Update best_practices.rst
Example of `autoload` in `composer.json`
1 parent 041c879 commit 970c26d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bundles/best_practices.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,9 @@ 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, example: ``"autoload": { "psr-4": { "JohnSmith\\BlogBundle\\": "" } }``
521523

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

0 commit comments

Comments
 (0)