File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
src/aleksip/DataTransformPlugin Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 27
27
"php" : " >=5.5.9" ,
28
28
"pattern-lab/core" : " ^2.6.3" ,
29
29
"pattern-lab/patternengine-twig" : " ^2.0.0"
30
+ },
31
+ "extra" : {
32
+ "patternlab" : {
33
+ "config" : {
34
+ "plugins" : {
35
+ "dataTransform" : {
36
+ "enabled" : true
37
+ }
38
+ }
39
+ }
40
+ }
30
41
}
31
42
}
Original file line number Diff line number Diff line change 3
3
namespace aleksip \DataTransformPlugin ;
4
4
5
5
use aleksip \DataTransformPlugin \Twig \PatternDataNodeVisitor ;
6
+ use PatternLab \Config ;
6
7
use PatternLab \Listener ;
7
8
use PatternLab \PatternEngine \Twig \TwigUtil ;
8
9
@@ -21,6 +22,11 @@ public function __construct()
21
22
22
23
public function twigPatternLoaderCustomize ()
23
24
{
25
+ $ enabled = Config::getOption ('plugins.dataTransform.enabled ' );
26
+ if (!is_null ($ enabled ) && !((bool )$ enabled )) {
27
+ return ;
28
+ }
29
+
24
30
$ this ->dt ?: $ this ->dt = new DataTransformer ();
25
31
$ this ->nv ?: $ this ->nv = new PatternDataNodeVisitor ($ this ->dt );
26
32
You can’t perform that action at this time.
0 commit comments