Skip to content

Instantly share code, notes, and snippets.

@prismicdeveloper
Created May 29, 2015 14:17
Show Gist options
  • Save prismicdeveloper/421cfbaecaceded8f3db to your computer and use it in GitHub Desktop.
Save prismicdeveloper/421cfbaecaceded8f3db to your computer and use it in GitHub Desktop.
// This goes to the app/app.php file, before the "page" route to take priority
// Let's add a route for our event type
$app->get('/event/:uid', function ($uid) use($app, $prismic) {
$doc = $prismic->by_uid('event', $uid);
if (!$doc) {
not_found($app);
return;
}
$skin = $prismic->get_skin();
render($app, "event", array('single_post' => $doc, 'skin' => $skin));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment