File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
src/PatternLab/PatternEngine/Twig/Loaders Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 12
12
13
13
namespace PatternLab \PatternEngine \Twig \Loaders ;
14
14
15
+ use \PatternLab \Config ;
15
16
use \PatternLab \PatternEngine \Loader ;
17
+ use \PatternLab \PatternEngine \Twig \TwigUtil ;
16
18
17
19
class FilesystemLoader extends Loader {
18
20
@@ -23,6 +25,7 @@ public function __construct($options = array()) {
23
25
24
26
$ twigLoader = new \Twig_Loader_Filesystem (array ($ options ["templatePath " ],$ options ["partialsPath " ]));
25
27
$ this ->instance = new \Twig_Environment ($ twigLoader );
28
+ $ this ->instance = TwigUtil::loadMacros ($ this ->instance , "filesystem " );
26
29
27
30
}
28
31
@@ -34,7 +37,7 @@ public function __construct($options = array()) {
34
37
*/
35
38
public function render ($ options = array ()) {
36
39
37
- return $ this ->instance ->render ($ options ["template " ].".twig " , $ options ["data " ]);
40
+ return $ this ->instance ->render ($ options ["template " ].". " .Config:: getOption ( " patternExtension " ) , $ options ["data " ]);
38
41
39
42
}
40
43
Original file line number Diff line number Diff line change 17
17
use \PatternLab \PatternEngine \Twig \Loaders \Twig \PatternPartialLoader as Twig_Loader_PatternPartialLoader ;
18
18
use \PatternLab \PatternEngine \Twig \Loaders \Twig \PatternStringLoader as Twig_Loader_PatternStringLoader ;
19
19
use \PatternLab \PatternEngine \Loader ;
20
+ use \PatternLab \PatternEngine \Twig \TwigUtil ;
20
21
21
22
class PatternLoader extends Loader {
22
23
@@ -31,6 +32,7 @@ public function __construct($options = array()) {
31
32
$ patternStringLoader = new \Twig_Loader_String ();
32
33
$ twigLoader = new \Twig_Loader_Chain (array ($ patternPartialLoader , $ patternStringLoader ));
33
34
$ this ->instance = new \Twig_Environment ($ twigLoader );
35
+ $ this ->instance = TwigUtil::loadMacros ($ this ->instance , "pattern " );
34
36
35
37
}
36
38
Original file line number Diff line number Diff line change 13
13
namespace PatternLab \PatternEngine \Twig \Loaders ;
14
14
15
15
use \PatternLab \PatternEngine \Loader ;
16
+ use \PatternLab \PatternEngine \Twig \TwigUtil ;
16
17
17
18
class StringLoader extends Loader {
18
19
@@ -23,6 +24,7 @@ public function __construct($options = array()) {
23
24
24
25
$ twigLoader = new \Twig_Loader_String ();
25
26
$ this ->instance = new \Twig_Environment ($ twigLoader );
27
+ $ this ->instance = TwigUtil::loadMacros ($ this ->instance , "string " );
26
28
27
29
}
28
30
You can’t perform that action at this time.
0 commit comments