Completed
Push — master ( 188ffb...31684b )
by Maxime
02:48
created

ErrorController::initStaticPart()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace Distilleries\Expendable\Http\Controllers\Backend\Base;
2
3
use \Exception;
4
5
class ErrorController extends BaseController {
6
7
8
    protected $layout = 'expendable::admin.layout.error';
9
    public function display(Exception $exception, $code)
10
    {
11
        $class = ($code == 404) ? 'page-404' : 'page-500';
12
13
        $content = view('expendable::admin.errors.default', [
14
            'code'    => $code,
15
            'class'    => $class,
16
            'message' => $exception->getMessage(),
17
        ]);
18
19
20
        $this->layoutManager->add([
21
            'class_layout'=>$class . '-full-page',
22
            'content'=>$content,
23
        ]);
24
25
        return response()->make($this->layoutManager->render(), $code);
26
    }
27
28
    // ------------------------------------------------------------------------------------------------
29
    // ------------------------------------------------------------------------------------------------
30
    // ------------------------------------------------------------------------------------------------
31
32
    protected function initStaticPart()
33
    {
34
        $this->layoutManager->initStaticPart();
35
    }
36
}