Skip to content

Commit

Permalink
Merge pull request #7 from whikloj/fix-register-twig
Browse files Browse the repository at this point in the history
Add our templates if we did not register the TwigServiceProvider
  • Loading branch information
ruebot committed May 26, 2016
2 parents 3b72f58 + 11556d8 commit 41ba8cf
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Provider/CrayfishProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ function (
}
)
);
} else {
# Add our templates to the existing twig instance.
$app['twig.loader']->addLoader(new \Twig_Loader_Filesystem(__DIR__ . '/../ResourceService/templates'));
}
if (!isset($app['api'])) {
$app['api'] = $app->share(
Expand Down Expand Up @@ -147,14 +150,7 @@ function ($id) use ($app) {
return $triple->s->getUri();
}
// Abort the routes if we don't get a subject from the tripple.
//$app->abort(404, sprintf('Failed getting resource Path for "%s" from triple store', $id));
return Response::create(
sprintf(
'Failed getting resource Path for "%s" from triple store',
$id
),
404
);
$app->abort(404, sprintf('Failed getting resource Path for "%s" from triple store', $id));
} else {
// If $id is empty then assume we are dealing with fedora base rest endpoint
return $app['config']['islandora']['fedoraProtocol']
Expand Down

0 comments on commit 41ba8cf

Please sign in to comment.