1 | <?php |
||
5 | trait AutoResolvesViews |
||
6 | { |
||
7 | /** |
||
8 | * @var null|\Illuminate\View\View |
||
9 | */ |
||
10 | protected $layout; |
||
11 | |||
12 | /** |
||
13 | * Find the view for the called method. |
||
14 | * |
||
15 | * @param null|string $view |
||
16 | * @param null|string $layout |
||
17 | * |
||
18 | * @return $this |
||
19 | */ |
||
20 | public function view($view = null, $layout = null) |
||
28 | |||
29 | /** |
||
30 | * Get an array of layout options if available. |
||
31 | * |
||
32 | * @param null|string $layout |
||
33 | * |
||
34 | * @return array|null |
||
35 | */ |
||
36 | protected function getLayoutOptions($layout) |
||
54 | |||
55 | /** |
||
56 | * Force the layout for the view. |
||
57 | * |
||
58 | * @param string $layout |
||
59 | */ |
||
60 | public function setViewLayout($layout) |
||
67 | |||
68 | /** |
||
69 | * Master template method |
||
70 | * Sets the template based on location and passes variables to the view. |
||
71 | * |
||
72 | * @return void |
||
73 | */ |
||
74 | public function setupLayout() |
||
78 | |||
79 | /** |
||
80 | * Execute an action on the controller. |
||
81 | * |
||
82 | * Overloading this method to make sure our layout is |
||
83 | * always used. |
||
84 | * |
||
85 | * @param string $method |
||
86 | * @param array $parameters |
||
87 | * |
||
88 | * @return \Symfony\Component\HttpFoundation\Response |
||
89 | */ |
||
90 | public function callAction($method, $parameters) |
||
100 | |||
101 | /** |
||
102 | * Catch a missing method and try to figure out what |
||
103 | * it should be. |
||
104 | * |
||
105 | * @param array $parameters |
||
106 | * |
||
107 | * @return mixed|void |
||
108 | */ |
||
109 | public function missingMethod($parameters = []) |
||
113 | |||
114 | /** |
||
115 | * Catch any un-found method and route through |
||
116 | * missing method. |
||
117 | * |
||
118 | * @param string $method |
||
119 | * @param array $parameters |
||
120 | * |
||
121 | * @return mixed|void |
||
122 | */ |
||
123 | public function __call($method, $parameters) |
||
129 | } |
||
130 |