Skip to content

Instantly share code, notes, and snippets.

@SasSam
Created October 24, 2014 10:45
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 SasSam/118fe3dcce2a2edcde0e to your computer and use it in GitHub Desktop.
Save SasSam/118fe3dcce2a2edcde0e to your computer and use it in GitHub Desktop.
Laravel 4.2 -Custom 404 with Layout
@extends('layouts.master')
@section('header')
@parent
@stop
@section('breadcrumbs')
// Some stuffs here
@stop
@section('content')
// Some stuffs here
@stop
@section('scripts')
@parent
@stop
<?php
class ErrorController extends BaseController {
protected $layout = 'layouts.master';
public function missing()
{
// Some stuffs here...
$this->layout->content = View::make('errors.404', array());
}
}
<?php
App::missing(function($exception)
{
return Redirect::to('404', 303)->with(
array('error' => array(
'url' => Request::url(),
)));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment