Skip to content

julian-koster/ContentfulBundle-Symfony-7

 
 

Repository files navigation

ContentfulBundle

Packagist PHP from Packagist CircleCI Packagist

Symfony Bundle for the Contentful Delivery SDK. This bundle requires PHP 7.2 or higher or PHP 8.0 or higher, and Symfony 3.4 or higher. It also requires Twig to be installed.

Disclaimer

This fork works for me on Symfony 7(.0.2), PHP 8.2, but it may not work for you. Test before using in an active environment.

Setup

Before adding the package via composer, ensure that you add the following to composer.json:

    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/juuuuln/contentful.php"
        },
        {
            "type": "vcs",
            "url": "https://github.com/juuuuln/ContentfulBundle-Symfony-7"
        }
    ],

This will allow composer to download the forks, rather than the original packages.

Add this package to your application by using Composer and executing the following command:

composer require contentful/contentful-bundle

Add ContentfulBundle to your application

// config/bundles.php
return [
    // ...
    Contentful\ContentfulBundle\ContentfulBundle::class => ['dev' => true],
    // ...
];

Configuration example

The simplest configuration includes just the space ID and token. Add these settings to either app/config.yml (Symfony 3) or create config/packages/contentful.yaml (Symfony 4):

contentful:
    delivery:
        main:
            space: cfexampleapi
            token: b4c0n73n7fu1

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

contentful:
    delivery:
        main:
            default: true
            space: cfexampleapi
            token: b4c0n73n7fu1
        preview:
            space: cfexampleapi
            token: b4c0n73n7fu1
            api: preview

Documentation

Getting Started Tutorial

What is Contentful?

Contentful provides a content infrastructure for digital teams to power content in websites, apps, and devices. Unlike a CMS, Contentful was built to integrate with the modern software stack. It offers a central hub for structured content, powerful management and delivery APIs, and a customizable web app that enable developers and content creators to ship digital products faster.

License

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

About

Symfony 7.0 (PHP 8.2) Bundle for the Contentful SDK.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 87.2%
  • Twig 12.5%
  • Shell 0.3%