2017 © Pedro Peláez
 

library zf2-prismic-module

ZF2 module for the Prismic PHP SDK. Simple wrapper and some added convenience.

image

netglue/zf2-prismic-module

ZF2 module for the Prismic PHP SDK. Simple wrapper and some added convenience.

  • Friday, December 15, 2017
  • by netglue
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

ZF2 Module for quick and easy installation of Prismic PHP SDK

Build Status Code Climate Test Coverage, (*1)

Routing

The module can currently helpfully determine which document corresponds to which Controller/Action by adding additional parameters to your routes., (*2)

Displaying a specific document that has been bookmarked would go something like this:, (*3)

// ...
'myRouteName' => array(
    'type' => 'Literal',
    'options' => array(
        'route' => '/some-where',
        'defaults' => array(
            'controller' => 'My\Controller',
            'action' => 'my-place',
            'bookmark' => 'my-bookmark-name',
        ),
    ),
),
// ...

Then, in your My\Controller :, (*4)

public function myPlaceAction()
{
    $document = $this->prismic()->getDocument();
}


'prismic' => array(
    'routeParameters' => array(
        'bookmark' => 'bookmark',
        'mask'     => 'mask',
        'ref'      => 'ref',
        'id'       => 'prismic-id',
        'slug'     => 'slug',
    ),
),

Automatic Page Meta

If you are in the habit of designing document masks that use the same document field for common page elements such as <title> and meta description, you can configure the module to watch out for these and trigger the appropriate view helper automatically. Current supported elements are:, (*5)

<title>
<meta name="description">
<meta property="og:title">
<meta property="og:description">
<meta property="og:image">

The automation is implemented by way of a listener that listens to the Prismic controller plugin NetgluePrismic\Mvc\Controller\Plugin\Prismic::setDocument method. Once we know what document we're dealing with for the current request, if enabled, the listener will examine the document and try to pair up document fields with meta data and call the appropriate zend view helper with the found information. Example configuration is found in config/module.config.php, (*6)

By default the listener, although attached, is not enabled., (*7)

The Versions

15/12 2017

dev-master

9999999-dev http://netglue.co/

ZF2 module for the Prismic PHP SDK. Simple wrapper and some added convenience.

  Sources   Download

The Requires

 

The Development Requires

zf2 netglue prismic.io

26/04 2017

0.2.0

0.2.0.0 http://netglue.co/

ZF2 module for the Prismic PHP SDK. Simple wrapper and some added convenience.

  Sources   Download

The Requires

 

The Development Requires

zf2 netglue prismic.io

21/05 2015

dev-uid

dev-uid http://netglue.co/

ZF2 module for the Prismic PHP SDK. Simple wrapper and some added convenience.

  Sources   Download

The Requires

 

The Development Requires

zf2 netglue prismic.io

08/04 2015

0.1.0

0.1.0.0 http://netglue.co/

ZF2 module for the Prismic PHP SDK. Simple wrapper and some added convenience.

  Sources   Download

The Requires

 

The Development Requires

zf2 netglue prismic.io

08/04 2015

dev-preview

dev-preview http://netglue.co/

ZF2 module for the Prismic PHP SDK. Simple wrapper and some added convenience.

  Sources   Download

The Requires

 

The Development Requires

zf2 netglue prismic.io

17/02 2015

dev-develop

dev-develop http://netglue.co/

ZF2 module for the Prismic PHP SDK. Simple wrapper and some added convenience.

  Sources   Download

The Requires

 

The Development Requires

zf2 netglue prismic.io