Skip to content

Commit cdc4b6d

Browse files
committed
Rewordings, fixes and tweaks
1 parent 6fe3e7e commit cdc4b6d

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

cookbook/bundles/best_practices.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,14 @@ class name.
6969

7070
Each bundle has an alias, which is the lower-cased short version of the bundle
7171
name using underscores (``acme_blog`` for ``AcmeBlogBundle``). This alias
72-
is used to enforce uniqueness within a bundle (see below for some usage examples).
72+
is used to enforce uniqueness within a bundle and for defining its configuration
73+
(see below for some usage examples).
7374

7475
Directory Structure
7576
-------------------
7677

77-
The basic directory structure of a AcmeBlogBundle must read as follows:
78+
The basic directory structure of an AcmeBlogBundle must read as follows (if you
79+
use `PSR-4`_ the ``Acme/`` and ``BlogBundle/`` folders might not exist):
7880

7981
.. code-block:: text
8082
@@ -85,6 +87,7 @@ The basic directory structure of a AcmeBlogBundle must read as follows:
8587
└─ BlogBundle/
8688
├─ AcmeBlogBundle.php
8789
├─ Controller/
90+
├─ README.md
8891
├─ Resources/
8992
│ ├─ meta/
9093
│ │ └─ LICENSE
@@ -101,7 +104,11 @@ that automated tools can rely on:
101104

102105
* ``AcmeBlogBundle.php``: This is the class that transforms a plain directory
103106
into a Symfony bundle;
104-
* ``Resources/meta/LICENSE``: The full license for the code;
107+
* ``README.md``: This file contains the basic description of the bundle and it
108+
usually shows some basic examples and links to its full documentation;
109+
* ``Resources/meta/LICENSE``: The full license for the code. The license file
110+
can also be stored in the bundle's root directory to follow the generic
111+
conventions about packages;
105112
* ``Resources/doc/index.rst``: The root file for the Bundle documentation.
106113

107114
The depth of sub-directories should be kept to the minimum for most used
@@ -301,12 +308,6 @@ The end user can provide values in any configuration file:
301308
// app/config/config.php
302309
$container->setParameter('acme_blog.author.email', 'fabien@example.com');
303310
304-
.. code-block:: ini
305-
306-
; app/config/config.ini
307-
[parameters]
308-
acme_blog.author.email = fabien@example.com
309-
310311
Retrieve the configuration parameters in your code from the container::
311312

312313
$container->getParameter('acme_blog.author.email');
@@ -319,7 +320,7 @@ Services
319320

320321
If the bundle defines services, they must be prefixed with the bundle alias.
321322
For an AcmeBlogBundle for instance, all services must be prefixed with
322-
``acme_blog_``.
323+
``acme_blog``.
323324

324325
In addition, services not meant to be used by the application directly, should
325326
be :ref:`defined as private <container-private-services>`.

0 commit comments

Comments
 (0)