2. Installation

2.1. Install the Bundle with Composer

In your project directory execute the following command to download the latest stable version:

1
composer require swp/bridge-bundle jms/serializer-bundle swp/jms-serializer-bridge

This command requires you to have Composer installed globally. If it’s not installed globally, download the .phar file locally as explained in Composer documentation.

2.2. Enable the bundle and its dependencies

Enable the bundle by adding the following lines in the app/AppKernel.php file:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new JMS\SerializerBundle\JMSSerializerBundle(),
            new SWP\Bundle\BridgeBundle\SWPBridgeBundle()
        );

        // ...
    }

    // ...
}

Note

All dependencies will be installed automatically. You will just need to configure the respective bundles if needed.

That’s it, the bundle is configured properly now!