Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //original source unknown
- <?php
- App::error(function(Exception $exception, $code) {
- if ($exception instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException) {
- Log::error('NotFoundHttpException Route: ' . Request::url() );
- }
- Log::error($exception);
- // HTML output on staging and production only
- if (!Config::get('app.debug'))
- return App::make("ErrorsController")->callAction("error", ['code'=>$code]);
- });
- //errors controller
- <?php
- class ErrorsController extends BaseController {
- protected $layout = "layouts.frontend";
- public function error($code) {
- switch ($code) {
- case 404:
- $this->layout->content = View::make('errors.404');
- break;
- default:
- $this->layout->content = View::make('errors.500');
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement