Skip to content

Commit f2d0eba

Browse files
committed
minor #10559 Update best_practices.rst (ThomasLandauer)
This PR was submitted for the 4.1 branch but it was merged into the 4.2 branch instead (closes #10559). Discussion ---------- Update best_practices.rst Example of `autoload` in `composer.json` Commits ------- 970c26d Update best_practices.rst
2 parents 041c879 + 970c26d commit f2d0eba

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)