2017 © Pedro PelĂĄez
 

symfony-bundle contentful-bundle

Contentful API content Reader

image

rudirocha/contentful-bundle

Contentful API content Reader

  • Saturday, January 2, 2016
  • by rudirocha
  • Repository
  • 1 Watchers
  • 2 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Contentful API Reader Bundle

This is a bundle for https://www.contentful.com API. Just create a Contentful account and follow the instructions. Add it for your app from packagist https://packagist.org/packages/rudirocha/contentful-bundle, (*1)

Instructions

Add necessary parameters sh #parameters.yml rubius_contentful_accesstoken: YOUR_PRODUCTION_ACCESS_TOKEN Enable Necessary bundles //AppKernel.php public function registerBundles() { $bundles = array( #... new Rubius\ContentfulBundle\RubiusContentfulBundle(), new Misd\GuzzleBundle\MisdGuzzleBundle() #... ); } Now at your controller (or where you want) ``` public function indexAction() { $contentClient = $this->get('rubius.contentful.delivery');, (*2)

    //get all entries from one space
    $contentObj = json_decode(
        (string) ($contentClient->getAllContentOfSpace('your_contentful_space_id')->getBody())
        );
    //get all entries from one content type of a space
    $contentResponseObject = json_decode(
    (string) ($contentClient->getContentOfType('your_contentful_space_id','content_type_id')->getBody())
    );

    /**
    * Query Entries 
    * ['fields.slug' => 'post-slug'] -> content type has field called slug
    */
    $content = (string)($contentClient->getContentEntryBy('your_contentful_space_id','content_type', ['fields.slug' => 'post-slug'])->getBody());
}

```, (*3)

Notes

This bundle is just a simple content reader! Have suggestions? ping me :), (*4)

The Versions

02/01 2016

dev-master

9999999-dev https://github.com/rudirocha/contentfulBundle

Contentful API content Reader

  Sources   Download

MIT

The Requires

 

by RĂșdi Rocha

api bundle symfony cms contentful

01/01 2016

v0.1

0.1.0.0 https://github.com/rudirocha/contentfulBundle

Contentful API content Reader

  Sources   Download

MIT

The Requires

 

by RĂșdi Rocha

api bundle symfony cms contentful