@@ -8,13 +8,13 @@ Most bundles provide a documentation of installation. However, most
8
8
steps are common for any bundle.
9
9
10
10
Add composer dependencies
11
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
+ -------------------------
12
12
13
- Starting from Symfony2.1 dependencies are managed via Composer. It's
14
- a good idea to learn some basics of Composer here:
15
- http://getcomposer.org/doc/00-intro.md .
13
+ Starting from Symfony2.1 dependencies are managed with Composer. It's
14
+ a good idea to learn some basics of Composer in
15
+ ` their documentation `_ .
16
16
17
- Before you can use composer to install a bundle you should look for a
17
+ Before you can use composer to install a bundle, you should look for a
18
18
`Packagist `_ package of that bundle. For example, for the
19
19
`FOSUserBundle `_ you should look for a
20
20
``friendsofsymfony/user-bundle `` package and it does exists:
@@ -25,25 +25,25 @@ https://packagist.org/packages/friendsofsymfony/user-bundle.
25
25
Packagist is the main archive for Composer. If you are searching
26
26
for a bundle, the best thing you can do is check out
27
27
`KnpBundles `_, it is the unofficial achive of Symfony Bundles. If
28
- a bundle contains a README file, it is displayed there and if it
28
+ a bundle contains a `` README `` file, it is displayed there and if it
29
29
has a Packagist package it shows a link to the package. It's a
30
30
really usefull site to begin searching for bundles.
31
31
32
32
Now you have the package name, you should determine the version you
33
33
want to use. Usually different versions of a bundle correspond to a
34
- particular version of Symfony, this should be in the README file (in
34
+ particular version of Symfony, this should be in the `` README `` file (in
35
35
the Package, which you can view on Github or KnpBundles). If it isn't
36
- in the README, you can use the version you want. In the case of
37
- FOSUserBundle README file has a caution that version 1.2.0 must be
36
+ in the `` README `` , you can use the version you want. In the case of the
37
+ FOSUserBundle, the `` README `` file has a caution that version 1.2.0 must be
38
38
used for Symfony2.0 and 1.3 for Symfony2.1+. Let's use development
39
39
version for this exmaple.
40
40
41
- Now we can add the bundle to our composer.json file and update the
41
+ Now we can add the bundle to our `` composer.json `` file and update the
42
42
dependencies. You can do this manually:
43
43
44
44
1. **Add it to the ``composer.json`` file: **
45
45
46
- .. code-block :: javascript
46
+ .. code-block :: json
47
47
48
48
{
49
49
...,
@@ -72,14 +72,12 @@ Or you can do this in one command:
72
72
$ php composer.phar require friendsofsymfony/user-bundle:dev-master
73
73
74
74
Enable the bundle
75
- ~~~~~~~~~~~~~~~~~
75
+ -----------------
76
76
77
77
Now the bundle is installed into our Symfony project (in
78
- vendor/friendsofsymfony/) and the autoloader recognises this
78
+ `` vendor/friendsofsymfony/ `` ) and the autoloader recognises this
79
79
bundle. The only thing we need to do now is registering the bundle in
80
- the AppKernel:
81
-
82
- .. code-block :: php
80
+ the ``AppKernel ``::
83
81
84
82
// app/AppKernel.php
85
83
@@ -88,10 +86,10 @@ the AppKernel:
88
86
{
89
87
// ...
90
88
91
- public function registerBundles()
92
- {
93
- $bundles = array(
94
- ...,
89
+ public function registerBundles()
90
+ {
91
+ $bundles = array(
92
+ // ...,
95
93
new FOS\UserBundle\FOSUserBundle(),
96
94
);
97
95
@@ -100,10 +98,10 @@ the AppKernel:
100
98
}
101
99
102
100
Configure the bundle
103
- ~~~~~~~~~~~~~~~~~~~~
101
+ --------------------
104
102
105
103
Usually bundles require some configuration to be added to app's
106
- app/config/config.yml file. Bundle's documentation will likely
104
+ `` app/config/config.yml `` file. Bundle's documentation will likely
107
105
describe that configuration. But you can also get a reference of the
108
106
bundle's config via ``config:dump-reference `` command.
109
107
@@ -134,8 +132,9 @@ The output will look like this:
134
132
java: /usr/bin/java
135
133
node: /usr/local/bin/node
136
134
node_paths: []
137
- ...
135
+ # ...
138
136
139
- .. _Packagist : https://packagist.org
140
- .. _FOSUserBundle : https://github.com/FriendsOfSymfony/FOSUserBundle
141
- .. _KnpBundles : http://knpbundles.com/
137
+ .. _their documentation : http://getcomposer.org/doc/00-intro.md
138
+ .. _Packagist : https://packagist.org
139
+ .. _FOSUserBundle : https://github.com/FriendsOfSymfony/FOSUserBundle
140
+ .. _KnpBundles : http://knpbundles.com/
0 commit comments