2017 © Pedro PelĂĄez
 

library php-sdk

PHP development kit for prismic.io

image

prismic/php-sdk

PHP development kit for prismic.io

  • Wednesday, February 14, 2018
  • by sre
  • Repository
  • 18 Watchers
  • 72 Stars
  • 129,234 Installations
  • PHP
  • 12 Dependents
  • 0 Suggesters
  • 39 Forks
  • 9 Open issues
  • 86 Versions
  • 11 % Grown

The README.md

Prismic.io PHP SDK

[Github Actions CI][github-actions-ci-href] Total Downloads Latest Stable Version License, (*1)

This is the official PHP SDK for Prismic.io, providing a straightforward way to connect to Prismic’s headless API. It is maintained by the community to help developers get started with Prismic in PHP., (*2)

  • Offers an easy-to-use interface for basic interactions with Prismic content
  • Covers core features of the Prismic API

Overview

  1. Getting started
    1. Installation
    2. Recommended PHP Extensions
    3. Basic Usage & API calls
    4. DOM Helper
  2. More information
  3. Contributing
  4. License

Getting started

Installation

Installation using Composer:, (*3)

$ composer require prismic/php-sdk

We recommend installing and enabeling the APCu extension to have the built-in default cache support. Otherwise, you can implement your own cache strategy by extending the Prismic\Cache\CacheInterface interface., (*4)

Basic Usage & API calls

If you are not using automatic autoloading, include the Composer autoload file:, (*5)

<?php
include_once __DIR__.'/../vendor/autoload.php';

use Prismic\Api;

Then you can start making your first API calls:, (*6)

$api = Api::get('https://your-repo-name.prismic.io/api/v2');
$document = $api->getByUID('get-started-type', 'get-started');

DOM Helper

The PHP SDK provides a set of DOM helpers to help you render your Prismic content., (*7)

In these examples we have a document variable corresponding to the fetched Prismic document. We also have a $linkResolver variable containing the functional link resolver, read our docs to learn more about Link Resolving., (*8)

<?php
use Prismic\Dom\Link;

echo Link::asUrl($document->data->link, $linkResolver);

Rich Text

<?php
use Prismic\Dom\RichText;

echo RichText::asText($document->data->title);
echo RichText::asHtml($document->data->description, $linkResolver);

Date

<?php
use Prismic\Dom\Date;

$date = Date::asDate($document->data->date);
echo $date->format('Y-m-d H:i:s');

More information

Contributing

Whether you're helping us fix bugs, improve the docs, or spread the word, we'd love to have you as part of the Prismic developer community!, (*9)

Reporting a bug: Open an issue explaining your application's setup and the bug you're encountering., (*10)

Suggesting an improvement: [Open an issue][repo-feature-request] explaining your improvement or feature so we can discuss and learn more., (*11)

Submitting code changes: For small fixes, feel free to open a pull request with a description of your changes. For large changes, please first [open an issue][repo-feature-request] so we can discuss if and how the changes should be implemented., (*12)

For more clarity on this project, check out the detailed CONTRIBUTING.md for our guidelines., (*13)

License

This software is licensed under the Apache 2 License, quoted below:, (*14)

Copyright 2013-2024 Prismic <contact@prismic.io> (https://prismic.io)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

The Versions

14/02 2018

dev-master

9999999-dev

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

14/02 2018

4.0.0-beta

4.0.0.0-beta

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

14/02 2018

dev-apiv2

dev-apiv2

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

05/02 2018

3.4.2

3.4.2.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

10/01 2018

dev-docs-gh-pages

dev-docs-gh-pages

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

19/12 2017

dev-jbdb/api-v2

dev-jbdb/api-v2

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

08/12 2017

3.4.1

3.4.1.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

17/10 2017

3.4.0

3.4.0.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

07/09 2017

3.3.2

3.3.2.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

11/08 2017

3.3.1

3.3.1.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

09/08 2017

dev-sre/remove-symphony-deps

dev-sre/remove-symphony-deps

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

15/06 2017

3.3.0

3.3.0.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

14/06 2017

dev-new-slice-wip

dev-new-slice-wip

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

22/03 2017

3.2.2

3.2.2.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

24/02 2017

3.2.1

3.2.1.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

23/01 2017

3.2.0

3.2.0.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

16/01 2017

dev-missing-helpers

dev-missing-helpers

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

19/10 2016

3.1.0

3.1.0.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

29/09 2016

dev-alw/cache

dev-alw/cache

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

07/09 2016

3.0.0

3.0.0.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

31/08 2016

2.0.3

2.0.3.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

05/07 2016

2.0.2

2.0.2.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

05/07 2016

2.0.1

2.0.1.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

25/04 2016

dev-travis

dev-travis

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

25/04 2016

2.0.0

2.0.0.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

01/03 2016

dev-guzzle

dev-guzzle

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

01/03 2016

2.0.0-beta1

2.0.0.0-beta1

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

01/03 2016

dev-fixtravis

dev-fixtravis

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

25/01 2016

1.7.1

1.7.1.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

23/11 2015

1.7.0

1.7.0.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

20/11 2015

1.6.1

1.6.1.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

12/11 2015

1.6.0

1.6.0.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

05/08 2015

1.5.12

1.5.12.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

22/06 2015

1.5.11

1.5.11.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

16/06 2015

1.5.10

1.5.10.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

27/05 2015

1.5.9

1.5.9.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

19/05 2015

1.5.8

1.5.8.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

12/05 2015

1.5.7

1.5.7.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

24/04 2015

1.5.6

1.5.6.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

23/04 2015

1.5.5

1.5.5.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

20/04 2015

1.5.4

1.5.4.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

08/04 2015

1.5.3

1.5.3.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

07/04 2015

1.5.2

1.5.2.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

03/04 2015

1.5.1

1.5.1.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

03/04 2015

1.5.0

1.5.0.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

02/04 2015

1.4.5

1.4.5.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

27/03 2015

1.4.4

1.4.4.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

26/02 2015

1.4.3

1.4.3.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

25/02 2015

1.4.2

1.4.2.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

19/02 2015

1.4.1

1.4.1.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

02/02 2015

1.4.0

1.4.0.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

02/02 2015

1.3.2

1.3.2.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

30/01 2015

1.3.1

1.3.1.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

22/01 2015

1.3.0

1.3.0.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

14/01 2015

1.2.1

1.2.1.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

14/01 2015

1.2.0

1.2.0.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

09/01 2015

1.1.1

1.1.1.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

09/01 2015

1.1.0

1.1.0.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

22/12 2014

1.0.25

1.0.25.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

17/12 2014

1.0.24

1.0.24.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

17/12 2014

1.0.23

1.0.23.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

17/12 2014

1.0.22

1.0.22.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

17/12 2014

1.0.21

1.0.21.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

16/12 2014

1.0.20

1.0.20.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

10/12 2014

1.0.19

1.0.19.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

05/12 2014

1.0.18

1.0.18.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

05/12 2014

1.0.17

1.0.17.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

27/11 2014

1.0.16

1.0.16.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

25/11 2014

1.0.15

1.0.15.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

18/11 2014

1.0.14

1.0.14.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

17/11 2014

1.0.13

1.0.13.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

14/11 2014

1.0.12

1.0.12.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

22/10 2014

1.0.11

1.0.11.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

14/10 2014

1.0.10

1.0.10.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

07/10 2014

1.0.9

1.0.9.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

22/09 2014

1.0.8

1.0.8.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

08/09 2014

1.0.7

1.0.7.0

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

24/07 2014

1.0.6-beta

1.0.6.0-beta

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

01/07 2014

1.0.5-beta

1.0.5.0-beta

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

26/06 2014

dev-php-unit

dev-php-unit

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

11/06 2014

1.0.4-beta

1.0.4.0-beta

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

04/11 2013

1.0.3-beta

1.0.3.0-beta

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

28/10 2013

1.0.2-beta

1.0.2.0-beta

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

21/10 2013

1.0.1-beta

1.0.1.0-beta

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

08/10 2013

dev-develop

dev-develop

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires

 

The Development Requires

03/10 2013

dev-standardize_code

dev-standardize_code

PHP development kit for prismic.io

  Sources   Download

Apache 2 license

The Requires