2017 © Pedro Peláez
 

library prismic

Cache Wrapper

image

gwsn/prismic

Cache Wrapper

  • Thursday, June 14, 2018
  • by xleeuwx
  • Repository
  • 1 Watchers
  • 0 Stars
  • 205 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 16 Versions
  • 173 % Grown

The README.md

Prismic.io Wrapper

Installation

Require this package, (*1)

composer require gwsn/prismic

Frameworks specific packages

  1. Lumen/Laravel composer require gwsn/lumen-transformer
  2. Symfony composer require gwsn/symfony-transformer

Simple example

Include the Transformer class:, (*2)

use Gwsn\Prismic\Transformer;, (*3)

In this use case we work only with arrays., (*4)

$source = [
    [
        'id'   => '1',
        'name' => 'Test 1',
        'type' => 'text',
        'text' => 'Some text written by Cicero that's used to fill spaces on.'
    ],
    [
        'id'   => '2',
        'name' => 'Test 2',
        'type' => 'short-text',
        'text' => 'The reason why it is difficult to understand is to draw attention away from the words on a page and to focus it on the design instead.'
    ],
    [
        'id'   => '3',
        'name' => 'Test 3',
        'type' => 'text',
        'text' => 'It's also useful for filling spaces where text should be because its words are about the same length as normal English writing.'
    ],
];

$mapping = [
    'guid' => 'id',
    'slug' => 'name',
    'type' => 'type',
    'text' => 'text',
];

$target = Transformer::run($source, Transformer::BuildMapping($mapping));

var_dump(json_encode($target)); 
output:

 [
     {
         guid: "1",
         slug: "Test Company mapper 1",
         type: "company",
         text: "asdasdfafa afad afads aadssafdf astext"
     },
     {
         guid: "2",
         slug: "Test Company mapper 2",
         type: "blog",
         text: "asdasdfafa afad afads aadssafdf astext"
     },
     {
         guid: "3",
         slug: "Test Company mapper 3",
         type: "company",
         text: "asdasdfafa afad afads aadssafdf astext"
     }
 ]

For the more advanced documentation about the usage you can find it here documentation, (*5)

The Versions

14/06 2018

dev-master

9999999-dev

Cache Wrapper

  Sources   Download

MIT

The Requires

 

by Jurn Overmars

cache tools

14/06 2018

0.3.1

0.3.1.0

Cache Wrapper

  Sources   Download

MIT

The Requires

 

by Jurn Overmars

cache tools

24/04 2018

0.3.0

0.3.0.0

Cache Wrapper

  Sources   Download

MIT

The Requires

 

by Jurn Overmars

cache tools

24/04 2018

0.2.9

0.2.9.0

Cache Wrapper

  Sources   Download

MIT

The Requires

 

by Jurn Overmars

cache tools

24/04 2018

0.2.8

0.2.8.0

Cache Wrapper

  Sources   Download

MIT

The Requires

 

by Jurn Overmars

cache tools

23/04 2018

0.2.7

0.2.7.0

Cache Wrapper

  Sources   Download

MIT

The Requires

 

by Jurn Overmars

cache tools

23/04 2018

0.2.6

0.2.6.0

Cache Wrapper

  Sources   Download

MIT

The Requires

 

by Jurn Overmars

cache tools

19/04 2018

0.2.5

0.2.5.0

Cache Wrapper

  Sources   Download

MIT

The Requires

 

by Jurn Overmars

cache tools

19/04 2018

0.2.4

0.2.4.0

Cache Wrapper

  Sources   Download

MIT

The Requires

 

by Jurn Overmars

cache tools

19/04 2018

0.2.3

0.2.3.0

Cache Wrapper

  Sources   Download

MIT

The Requires

 

by Jurn Overmars

cache tools

19/04 2018

0.2.2

0.2.2.0

Cache Wrapper

  Sources   Download

MIT

The Requires

 

by Jurn Overmars

cache tools

19/04 2018

0.2.1

0.2.1.0

Cache Wrapper

  Sources   Download

MIT

The Requires

 

by Jurn Overmars

cache tools

18/04 2018

0.2.0

0.2.0.0

Cache Wrapper

  Sources   Download

MIT

The Requires

 

by Jurn Overmars

cache tools

18/04 2018

0.1.2

0.1.2.0

Cache Wrapper

  Sources   Download

MIT

The Requires

 

by Jurn Overmars

cache tools

06/04 2018

0.1.1

0.1.1.0

Cache Wrapper

  Sources   Download

MIT

The Requires

  • php >=7.1

 

by Jurn Overmars

cache tools

24/03 2018

0.1.0

0.1.0.0

Cache Wrapper

  Sources   Download

MIT

The Requires

  • php >=7.1

 

by Jurn Overmars

cache tools