Created
October 24, 2014 10:45
-
-
Save SasSam/118fe3dcce2a2edcde0e to your computer and use it in GitHub Desktop.
Laravel 4.2 -Custom 404 with Layout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layouts.master') | |
@section('header') | |
@parent | |
@stop | |
@section('breadcrumbs') | |
// Some stuffs here | |
@stop | |
@section('content') | |
// Some stuffs here | |
@stop | |
@section('scripts') | |
@parent | |
@stop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ErrorController extends BaseController { | |
protected $layout = 'layouts.master'; | |
public function missing() | |
{ | |
// Some stuffs here... | |
$this->layout->content = View::make('errors.404', array()); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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