1 | <?php |
||
8 | class View |
||
9 | { |
||
10 | /** |
||
11 | * @var null|string |
||
12 | */ |
||
13 | public $layout = null; |
||
14 | /** |
||
15 | * @var null|string |
||
16 | */ |
||
17 | public $fullController = null; |
||
18 | |||
19 | /** |
||
20 | * @var null|string |
||
21 | */ |
||
22 | public $configIndex = null; |
||
23 | |||
24 | /** |
||
25 | * @var null|string |
||
26 | */ |
||
27 | public $prefix = null; |
||
28 | |||
29 | /** |
||
30 | * @var null|string |
||
31 | */ |
||
32 | public $controller = null; |
||
33 | |||
34 | /** |
||
35 | * @var null|string |
||
36 | */ |
||
37 | public $action = null; |
||
38 | |||
39 | /** |
||
40 | * @var null|string |
||
41 | */ |
||
42 | public $view = null; |
||
43 | |||
44 | /** |
||
45 | * @var string |
||
46 | */ |
||
47 | public $type = 'manual'; |
||
48 | |||
49 | /** |
||
50 | * @var Collection |
||
51 | */ |
||
52 | public $prefixes; |
||
53 | |||
54 | /** |
||
55 | * @var Collection |
||
56 | */ |
||
57 | public $attemptedViews; |
||
58 | |||
59 | /** |
||
60 | * @param array $routeParts |
||
61 | * @param null $layout |
||
62 | */ |
||
63 | public function __construct(array $routeParts = [], $layout = null) |
||
75 | |||
76 | /** |
||
77 | * Find the most reasonable view available. |
||
78 | * |
||
79 | * @return null |
||
80 | */ |
||
81 | public function getView() |
||
121 | |||
122 | /** |
||
123 | * When a view is checked, add it to attempted. |
||
124 | * |
||
125 | * @param string $view |
||
126 | */ |
||
127 | protected function attempted($view) |
||
131 | |||
132 | /** |
||
133 | * Combine a prefix and view to get a full path. |
||
134 | * |
||
135 | * @param string $prefix |
||
136 | * @param string $view |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | public function concatViewAndPrefix($prefix, $view) |
||
148 | |||
149 | /** |
||
150 | * Get a properly formatted controller name. |
||
151 | * |
||
152 | * @param string $class |
||
153 | * |
||
154 | * @return string |
||
155 | */ |
||
156 | protected function parseController($class) |
||
163 | |||
164 | /** |
||
165 | * Get a properly formatted action name. |
||
166 | * |
||
167 | * @param string $action |
||
168 | * |
||
169 | * @return string |
||
170 | */ |
||
171 | protected function parseAction($action) |
||
181 | |||
182 | /** |
||
183 | * Search for any prefixes attached to this route. |
||
184 | * |
||
185 | * @return string |
||
186 | */ |
||
187 | protected function getPrefixes() |
||
202 | |||
203 | /** |
||
204 | * Remove the last prefix if it matches the controller. |
||
205 | * |
||
206 | * @param \Illuminate\Support\Collection $prefixes |
||
207 | * |
||
208 | * @return mixed |
||
209 | */ |
||
210 | protected function removeControllerFromPrefixes($prefixes) |
||
218 | |||
219 | /** |
||
220 | * Combine the controller and action to create a proper view string. |
||
221 | */ |
||
222 | protected function setView() |
||
231 | |||
232 | /** |
||
233 | * Return the base view if it exists. |
||
234 | * |
||
235 | * @return null|string |
||
236 | */ |
||
237 | private function getBaseView() |
||
243 | |||
244 | /** |
||
245 | * Check the view routing config for the controller and method. |
||
246 | * |
||
247 | * @return null|string |
||
248 | */ |
||
249 | public function checkConfig() |
||
260 | } |
||
261 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: