Completed
Push — master ( 4eb77d...f30482 )
by ARCANEDEV
09:06 queued 13s
created

FoundationController::beforeViewRender()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php namespace Arcanesoft\Foundation\Bases;
2
3
/**
4
 * Class     FoundationController
5
 *
6
 * @package  Arcanesoft\Foundation\Bases
7
 * @author   ARCANEDEV <[email protected]>
8
 */
9
class FoundationController extends Controller
10
{
11
    /* ------------------------------------------------------------------------------------------------
12
     |  Properties
13
     | ------------------------------------------------------------------------------------------------
14
     */
15
    /**
16
     * The view namespace.
17
     *
18
     * @var string
19
     */
20
    protected $viewNamespace = 'foundation';
21
22
    /* ------------------------------------------------------------------------------------------------
23
     |  Constructor
24
     | ------------------------------------------------------------------------------------------------
25
     */
26
    /**
27
     * Instantiate the controller.
28
     */
29
    public function __construct()
30
    {
31
        parent::__construct();
32
33
        $this->setTemplate(config('arcanesoft.foundation.template'));
34
        $this->registerBreadcrumbs('foundation');
35
    }
36
37
    /* ------------------------------------------------------------------------------------------------
38
     |  Breadcrumbs Functions
39
     | ------------------------------------------------------------------------------------------------
40
     */
41
    /**
42
     * Get the breadcrumbs home item (root).
43
     *
44
     * @return array
45
     */
46
    protected function getBreadcrumbsHomeItem()
47
    {
48
        return [
49
            'title' => 'Home',
50
            'url'   => route('foundation::home')
51
        ];
52
    }
53
54
    /* ------------------------------------------------------------------------------------------------
55
     |  Views Functions
56
     | ------------------------------------------------------------------------------------------------
57
     */
58
    /**
59
     * Display the view.
60
     *
61
     * @param  string  $name
62
     * @param  array   $data
63
     *
64
     * @return \Illuminate\View\View
65
     */
66
    protected function view($name, array $data = [])
67
    {
68
        if ( ! is_null($this->viewNamespace)) {
69
            $name = "{$this->viewNamespace}::$name";
70
        }
71
72
        return parent::view($name, $data);
73
    }
74
75
    /**
76
     * Do random stuff before rendering view.
77
     */
78
    protected function beforeViewRender()
79
    {
80
        $this->loadBreadcrumbs();
81
    }
82
}
83