@@ -7,32 +7,32 @@ |
||
7 | 7 | |
8 | 8 | class TemplateLoader { |
9 | 9 | |
10 | - protected $fs; |
|
10 | + protected $fs; |
|
11 | 11 | |
12 | - protected $loaded; |
|
12 | + protected $loaded; |
|
13 | 13 | |
14 | - public function __construct(Filesystem $fs) |
|
15 | - { |
|
16 | - $this->fs = $fs; |
|
17 | - $this->loaded = []; |
|
18 | - } |
|
14 | + public function __construct(Filesystem $fs) |
|
15 | + { |
|
16 | + $this->fs = $fs; |
|
17 | + $this->loaded = []; |
|
18 | + } |
|
19 | 19 | |
20 | - public function load($name) |
|
21 | - { |
|
22 | - if(! isset($this->loaded[$name])){ |
|
23 | - $path = __DIR__ . "/../../templates/{$name}.wnt"; |
|
20 | + public function load($name) |
|
21 | + { |
|
22 | + if(! isset($this->loaded[$name])){ |
|
23 | + $path = __DIR__ . "/../../templates/{$name}.wnt"; |
|
24 | 24 | |
25 | - if($customPath = config("lumen-generators.custom_templates.{$name}")){ |
|
26 | - $path = $customPath; |
|
25 | + if($customPath = config("lumen-generators.custom_templates.{$name}")){ |
|
26 | + $path = $customPath; |
|
27 | 27 | } |
28 | 28 | |
29 | - try { |
|
30 | - $this->loaded[$name] = $this->fs->get($path); |
|
31 | - } catch(\Exception $e) { |
|
32 | - throw new TemplateException("Unable to read the file '{$path}'"); |
|
33 | - } |
|
34 | - } |
|
35 | - return new Template($this, $this->loaded[$name]); |
|
36 | - } |
|
29 | + try { |
|
30 | + $this->loaded[$name] = $this->fs->get($path); |
|
31 | + } catch(\Exception $e) { |
|
32 | + throw new TemplateException("Unable to read the file '{$path}'"); |
|
33 | + } |
|
34 | + } |
|
35 | + return new Template($this, $this->loaded[$name]); |
|
36 | + } |
|
37 | 37 | |
38 | 38 | } |