Conditions | 2 |
Paths | 2 |
Total Lines | 23 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public static function __callStatic($name, $arguments) |
||
19 | { |
||
20 | $app = app(); |
||
21 | $view = view(); |
||
22 | |||
23 | if (count($arguments) === 0) { |
||
24 | throw new InvalidArgumentException(); |
||
25 | } |
||
26 | |||
27 | $fileName = $arguments[0]; |
||
28 | $params = $arguments[1] ?? []; |
||
29 | $orgFinder = $view->getFinder(); |
||
30 | $sqlPath = resource_path() . '/' . $name; |
||
31 | |||
32 | $newFinder = new FileViewFinder($app['files'], [$sqlPath]); |
||
33 | $view->setFinder($newFinder); |
||
34 | $view->addExtension($name, 'blade'); |
||
35 | $obj = $view->make($fileName, $params); |
||
36 | |||
37 | $result = $obj->render(); |
||
38 | $view->setFinder($orgFinder); |
||
39 | |||
40 | return $result; |
||
|
|||
41 | } |
||
43 |