Developed with love by KnpLabs Hire us for your project!
14

SymfonyBundle

by prismicio

Inntegrates the http://prismic.io php-kit with the Symfony Framework

PrismicBundle

This Bundle integrates the http://prismic.io php-kit with the Symfony Framework:
https://github.com/prismicio/php-kit

For an example use see:
https://github.com/prismicio/php-symfony-starter

Installation

Add the following dependencies to your projects composer.json file:

"require": {
    # ..
    "prismic/prismic-bundle": "~1.0@dev"
    # ..
}

Configuration

Add the following configuration to your projects app/config/config.yml file:

# Default configuration for extension with alias: "prismic"
prismic:
    api:
        endpoint:             ~ # Required
        access_token:         ~
        client_id:            ~
        client_secret:        ~

If you would like to have OAuth authentication in your app so you can preview upcoming releases for example. You must import the OAuth specific routes in your app/config/routing.yml file:

# Default OAuth routes which will redirect to the "home" route after signin/signout
prismic_oauth:
    resource: "@PrismicBundle/Resources/config/routing/oauth.xml"

You can override the redirect route from the bundle configuration:

# Default configuration for extension with alias: "prismic"
prismic:
    oauth:
        redirect_route:         home # Name of the route
        redirect_route_params:  []   # An array with additional route params

TODOs

  • [x] Add a listener for Symfony 2.3 to set the request data into the context as 2.3 does not support ExpressionLanguage
  • [ ] Add unit (and functional?) tests
  • [ ] Provide twig templates to render documents
  • [ ] Make caching configurable once https://github.com/prismicio/php-kit/issues/32 is implemented

Credits

Kudos to lsmith77 who did all the hard work!

prismic:
api: # Required
endpoint: ~ # Required
access_token: ~
client_id: ~
client_secret: ~
oauth:
redirect_route: home
redirect_route_params: Array
cache: true
  • Merge pull request #15 from haagvivi/patch-1
    By , 3 years ago
  • Fix 5.3.3 compatibility
    By , 3 years ago
  • Update kit version
    By erwan, 3 years ago
  • Upgrade kit version
    By erwan, 3 years ago
  • Update kit version
    By erwan, 3 years ago
  • Update kit version
    By erwan, 3 years ago
  • Previews
    By erwan, 3 years ago
  • Previews
    By erwan, 3 years ago
  • Update kit version
    By erwan, 3 years ago
  • The OAuthController is now a service so it can be reused by non-SF apps (Silex for example).
    By RobinvdVleuten, 3 years ago
  • Expose the helper from the context.
    By RobinvdVleuten, 3 years ago
  • Added pagination to both overviews. Closes #14.
    By RobinvdVleuten, 3 years ago
  • If the ref in query is empty, do not add.
    By RobinvdVleuten, 3 years ago
  • Setting the ref only works for master request.
    By RobinvdVleuten, 3 years ago
  • The redirect route is configurable.
    By RobinvdVleuten, 3 years ago
  • Moved oauth routes out of routing.xml so you can import them separately.
    By RobinvdVleuten, 3 years ago
  • signout route should be callable.
    By RobinvdVleuten, 3 years ago
  • access token is stored in session.
    By RobinvdVleuten, 3 years ago
  • I added a listener in a previous commit.
    By RobinvdVleuten, 3 years ago
  • Minimum stability isn't needed here.
    By RobinvdVleuten, 3 years ago
  • Locked the bundle to php-sdk 1.0.5-beta. Fixes #13.
    By RobinvdVleuten, 3 years ago
  • Cache can be turned on or off.
    By RobinvdVleuten, 3 years ago
  • The cache and client instance are now injected into the helper.
    By RobinvdVleuten, 3 years ago
  • Merge pull request #6 from eMeRiKa13/master
    By RobinvdVleuten, 3 years ago
  • Use a listener to set ref and accessToken on context. Closes #12.
    By RobinvdVleuten, 3 years ago
  • Bumped sdk version to 1.0.5.*@dev as 1.0.4.*@dev is removed.
    By RobinvdVleuten, 3 years ago
  • Merge pull request #7 from RobinvdVleuten/master
    By RobinvdVleuten, 3 years ago
  • Merge pull request #10 from RobinvdVleuten/composer-lock
    By rudyrigot, 3 years ago
  • Add a composer.lock file to freeze dep versions and added correct alias for prismic-kit
    By RobinvdVleuten, 3 years ago
  • Replaced RouterInterface with UrlGeneratorInterface for better extendability.
    By RobinvdVleuten, 3 years ago