Skip to content

Instantly share code, notes, and snippets.

@rodrigoSyscop
Created March 10, 2018 17:24
Show Gist options
  • Save rodrigoSyscop/d516ea21888457a95277f353240f1d49 to your computer and use it in GitHub Desktop.
Save rodrigoSyscop/d516ea21888457a95277f353240f1d49 to your computer and use it in GitHub Desktop.
framework/web/front.php
<?php //framework/web/front.php
// ...
try {
$request->attributes->add($matcher->match($request->getPathInfo()));
$response = call_user_func('render_template', $request);
} catch (Routing\Exception\ResourceNotFoundException $exception) {
$response = new Response('Not Found', 404);
} catch (Exception $exception) {
$response = new Response('An error occurred', 500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment