File tree Expand file tree Collapse file tree 1 file changed +17
-16
lines changed
src/TwigComponent/src/Twig Expand file tree Collapse file tree 1 file changed +17
-16
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,23 @@ public function compile(Compiler $compiler): void
73
73
->raw ("; \n" )
74
74
->outdent ()
75
75
->write ('} ' )
76
- ->write ("\n" );
76
+ ->write ("\n" )
77
+ ;
78
+
79
+ // overwrite the context value if a props with a similar name and a default value exist
80
+ if ($ this ->hasNode ($ name )) {
81
+ $ compiler
82
+ ->write ('if (isset($context[ \'__context \'][ \'' .$ name .'\'])) { ' )
83
+ ->raw ("\n" )
84
+ ->indent ()
85
+ ->write ('$context[ \'' .$ name .'\'] = ' )
86
+ ->subcompile ($ this ->getNode ($ name ))
87
+ ->raw ("; \n" )
88
+ ->outdent ()
89
+ ->write ('} ' )
90
+ ->raw ("\n" )
91
+ ;
92
+ }
77
93
}
78
94
79
95
$ compiler
@@ -94,20 +110,5 @@ public function compile(Compiler $compiler): void
94
110
->write ('} ' )
95
111
->raw ("\n" )
96
112
;
97
-
98
- // overwrite the context value if a props with a similar name and a default value exist
99
- if ($ this ->hasNode ($ name )) {
100
- $ compiler
101
- ->write ('if (isset($context[ \'__context \'][ \'' .$ name .'\'])) { ' )
102
- ->raw ("\n" )
103
- ->indent ()
104
- ->write ('$context[ \'' .$ name .'\'] = ' )
105
- ->subcompile ($ this ->getNode ($ name ))
106
- ->raw ("; \n" )
107
- ->outdent ()
108
- ->write ('} ' )
109
- ->raw ("\n" )
110
- ;
111
- }
112
113
}
113
114
}
You can’t perform that action at this time.
0 commit comments