Skip to content

Instantly share code, notes, and snippets.

@rudyrigot
Created March 19, 2014 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rudyrigot/9649355 to your computer and use it in GitHub Desktop.
Save rudyrigot/9649355 to your computer and use it in GitHub Desktop.
Bootstrap prismic.io blogpost - minimal controller in index.php
<?php
/* Initializations */
require_once '../resources/config.php'; // this loads our specific configuration
require_once(LIBRARIES_PATH . "/Prismic.php"); // this loads our Prismic helpers, which include the prismic.io PHP kit
$ctx = Prismic::context(); // getting the context built from our configuration (including the Api object it initializes)
global $linkResolver; // getting the linkResolver object (more on this later)
/* Controller */
try {
// API calls will go here
} catch (Guzzle\Http\Exception\BadResponseException $e) {
Prismic::handlePrismicException($e); // We need to catch any network issue, and render it properly
}
?>
// static webpage will go here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment