@@ -18,26 +18,26 @@ |
||
18 | 18 | */ |
19 | 19 | class View |
20 | 20 | { |
21 | - /** |
|
22 | - * Returns the view at the given path with the given data. |
|
23 | - * |
|
24 | - * @param string $path |
|
25 | - * @param string[] $data = [] |
|
26 | - * @return string a string representation of the view. |
|
27 | - */ |
|
28 | - public static function get($path, $data = []) |
|
29 | - { |
|
30 | - ob_start(); |
|
21 | + /** |
|
22 | + * Returns the view at the given path with the given data. |
|
23 | + * |
|
24 | + * @param string $path |
|
25 | + * @param string[] $data = [] |
|
26 | + * @return string a string representation of the view. |
|
27 | + */ |
|
28 | + public static function get($path, $data = []) |
|
29 | + { |
|
30 | + ob_start(); |
|
31 | 31 | |
32 | - extract($data); |
|
32 | + extract($data); |
|
33 | 33 | |
34 | - try { |
|
35 | - include $path; |
|
36 | - } catch (\Exception $e) { |
|
37 | - ob_get_clean(); |
|
38 | - throw $e; |
|
39 | - } |
|
34 | + try { |
|
35 | + include $path; |
|
36 | + } catch (\Exception $e) { |
|
37 | + ob_get_clean(); |
|
38 | + throw $e; |
|
39 | + } |
|
40 | 40 | |
41 | - return ob_get_clean(); |
|
42 | - } |
|
41 | + return ob_get_clean(); |
|
42 | + } |
|
43 | 43 | } |