1 | <?php namespace Arcanedev\Support\Http; |
||
12 | abstract class Controller extends IlluminateController |
||
13 | { |
||
14 | /* ----------------------------------------------------------------- |
||
15 | | Traits |
||
16 | | ----------------------------------------------------------------- |
||
17 | */ |
||
18 | |||
19 | use Abortable; |
||
20 | |||
21 | /* ----------------------------------------------------------------- |
||
22 | | Properties |
||
23 | | ----------------------------------------------------------------- |
||
24 | */ |
||
25 | |||
26 | /** |
||
27 | * The view data. |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $data = []; |
||
32 | |||
33 | /* ----------------------------------------------------------------- |
||
34 | | Constructor |
||
35 | | ----------------------------------------------------------------- |
||
36 | */ |
||
37 | |||
38 | /** |
||
39 | * Controller constructor. |
||
40 | */ |
||
41 | 8 | public function __construct() |
|
45 | |||
46 | /* ----------------------------------------------------------------- |
||
47 | | Getters & Setters |
||
48 | | ----------------------------------------------------------------- |
||
49 | */ |
||
50 | |||
51 | /** |
||
52 | * Get data. |
||
53 | * |
||
54 | * @return array |
||
55 | */ |
||
56 | protected function getData() |
||
60 | |||
61 | /** |
||
62 | * Set view data. |
||
63 | * |
||
64 | * @param string|array $name |
||
65 | * @param mixed $value |
||
66 | * |
||
67 | * @return self |
||
68 | */ |
||
69 | 8 | protected function setData($name, $value = null) |
|
70 | { |
||
71 | 8 | if (is_array($name)) { |
|
72 | $this->data = array_merge($this->data, $name); |
||
73 | } |
||
74 | 8 | elseif (is_string($name)) { |
|
75 | 8 | $this->data[$name] = $value; |
|
76 | } |
||
77 | |||
78 | 8 | return $this; |
|
79 | } |
||
80 | |||
81 | /** |
||
82 | * Set the current page. |
||
83 | * |
||
84 | * @param string $page |
||
85 | * |
||
86 | * @return self |
||
87 | */ |
||
88 | 8 | protected function setCurrentPage($page = '') |
|
92 | } |
||
93 |