Skip to content

Commit e78ab7e

Browse files
committed
Merge pull request #875 from WouterJ/patch-1
Use standard bundle installation template
2 parents 717165a + b7ac2d8 commit e78ab7e

File tree

1 file changed

+25
-20
lines changed

1 file changed

+25
-20
lines changed
Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
Step 1: Setting up the bundle
22
=============================
33

4-
A) Install FOSRestBundle
5-
------------------------
4+
A) Download the Bundle
5+
----------------------
6+
7+
Open a command console, enter your project directory and execute the
8+
following command to download the latest stable version of this bundle:
9+
10+
.. code-block:: bash
11+
12+
$ composer require friendsofsymfony/rest-bundle "~1.4"
13+
14+
This command requires you to have Composer installed globally, as explained
15+
in the `installation chapter`_ of the Composer documentation.
616

717
.. note::
818

@@ -14,36 +24,31 @@ A) Install FOSRestBundle
1424
But in this case, you need to manually set it up and configure FOSRestBundle
1525
to use it via the ``service`` section in the app config
1626

17-
Simply run assuming you have installed ``composer.phar`` or ``composer`` binary:
18-
19-
.. code-block:: bash
20-
21-
$ composer require friendsofsymfony/rest-bundle
22-
23-
B) Enable the bundle
27+
B) Enable the Bundle
2428
--------------------
2529

26-
Finally, enable the bundle in the kernel:
30+
Then, enable the bundle by adding the following line in the ``app/AppKernel.php``
31+
file of your project:
2732

2833
.. code-block:: php
2934
30-
<?php
3135
// app/AppKernel.php
32-
33-
public function registerBundles()
36+
class AppKernel extends Kernel
3437
{
35-
$bundles = array(
38+
public function registerBundles()
39+
{
40+
$bundles = array(
41+
// ...
42+
new FOS\RestBundle\FOSRestBundle(),
43+
);
44+
3645
// ...
37-
new FOS\RestBundle\FOSRestBundle(),
38-
39-
// if you choose to use JMSSerializer, make sure that it is registered in your application
40-
41-
// new JMS\SerializerBundle\JMSSerializerBundle(),
42-
);
46+
}
4347
}
4448
4549
That was it!
4650

51+
.. _`installation chapter`: https://getcomposer.org/doc/00-intro.md
4752
.. _`JMSSerializer`: https://github.com/schmittjoh/serializer
4853
.. _`JMSSerializerBundle`: https://github.com/schmittjoh/JMSSerializerBundle
4954
.. _`Symfony Serializer`: https://github.com/symfony/Serializer

0 commit comments

Comments
 (0)