/ContentfulBundle

Symfony Bundle for the Contentful SDK.

Primary LanguagePHPMIT LicenseMIT

ContentfulBundle

Build Status codecov

Symfony Bundle for the Contentful SDK.

Contentful is a content management platform for web applications, mobile apps and connected devices. It allows you to create, edit & manage content in the cloud and publish it anywhere via powerful API. Contentful offers tools for managing editorial teams and enabling cooperation between organizations.

This Bundle requires at least PHP 5.5.9 and Symfony 2.7. PHP 7 and Symfony 3 are supported.

Setup

To add this package to your composer.json and install it execute the following command:

php composer.phar require contentful/contentful-bundle

Add ContentfulBundle to your application kernel

// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Contentful\ContentfulBundle\ContentfulBundle(),
        // ...
    );
}

Configuration example

The simplest configuration includes just the space ID and token:

contentful:
  delivery:
    space: cfexampleapi
    token: b4c0n73n7fu1

You can also configure multiple clients and enable the preview mode:

contentful:
  delivery:
    default_client: exampleapi
    clients:
      exampleapi:
        space: cfexampleapi
        token: b4c0n73n7fu1
      exapleapi_preview:
        space: cfexampleapi
        token: b4c0n73n7fu1
        preview: true

Documentation

Getting Started Tutorial

License

Copyright (c) 2015-2017 Contentful GmbH. Code released under the MIT license. See LICENSE for further details.