File tree Expand file tree Collapse file tree 1 file changed +23
-10
lines changed
src/TwigComponent/src/Twig Expand file tree Collapse file tree 1 file changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -154,16 +154,29 @@ public function compile(Compiler $compiler): void
154
154
if ($ useYield ) {
155
155
$ compiler ->write ('yield from ' );
156
156
}
157
- $ compiler
158
- ->write ('$this->loadTemplate( ' )
159
- ->string ($ this ->getAttribute ('embedded_template ' ))
160
- ->raw (', ' )
161
- ->repr ($ this ->getTemplateName ())
162
- ->raw (', ' )
163
- ->repr ($ this ->getTemplateLine ())
164
- ->raw (', ' )
165
- ->string ($ this ->getAttribute ('embedded_index ' ))
166
- ->raw (') ' );
157
+
158
+ if (Environment::VERSION_ID >= 32100 ) {
159
+ $ compiler
160
+ ->write ('$this->load( ' )
161
+ ->string ($ this ->getAttribute ('embedded_template ' ))
162
+ ->raw (', ' )
163
+ ->repr ($ this ->getTemplateLine ())
164
+ ->raw (', ' )
165
+ ->string ($ this ->getAttribute ('embedded_index ' ))
166
+ ->raw (') ' );
167
+ } else {
168
+ // @deprecated since Twig 3.21
169
+ $ compiler
170
+ ->write ('$this->loadTemplate( ' )
171
+ ->string ($ this ->getAttribute ('embedded_template ' ))
172
+ ->raw (', ' )
173
+ ->repr ($ this ->getTemplateName ())
174
+ ->raw (', ' )
175
+ ->repr ($ this ->getTemplateLine ())
176
+ ->raw (', ' )
177
+ ->string ($ this ->getAttribute ('embedded_index ' ))
178
+ ->raw (') ' );
179
+ }
167
180
168
181
if ($ useYield ) {
169
182
$ compiler ->raw ('->unwrap()->yield( ' );
You can’t perform that action at this time.
0 commit comments