Menu
Cart

TWIG to TPL converter

TWIG
TPL

Supported constructions
TWIGTPL
{{ _context[variable] }}<?php echo $$variable; ?>
{{ variable }}<?php echo $variable; ?>
{{ array.index }}<?php echo $array['index']; ?>
{{ array[variable] }}<?php echo $array[$variable]; ?>
{% if variable %}<?php if ($variable): ?>
{% if (array.index) %}<?php if ($array['index']): ?>
{% if (variable1 and!=<>|&or variable2) %}{% if (variable1 and!=<>|&or variable2) %}
{% if (array.index and!=<>|&or variable2) %}{% if (array.index and!=<>|&or variable2) %}
{% else %}<?php else: ?>
{% endif %}<?php endif; ?>
{% for item in items %}<?php foreach ($items as $item) { ?>
{% for item in variable.items %}<?php foreach ($variable['items'] as $item) { ?>
{% for item in 1..5 %}<?php for($item=1;$item<=5;$item++) { ?>
{% endfor %}<?php } ?>
{{ array.index ? variable1 : variable2 }}<?php echo $array['index'] ? $variable1 : $variable2; ?>
{{ variable ? variable1 : variable2 }}<?php echo $variable ? $variable1 : $variable2; ?>
{{ array.index and!=<>|&or 09 ? "string1" : "string2" }}{{ array.index and!=<>|&or 09 ? "string1" : "string2" }}
{{ array.index and!=<>|&or variable ? "string1" : "string2" }}{{ array.index and!=<>|&or variable ? "string1" : "string2" }}
{{ variable and!=<>|&or 09 ? "string1" : "string2" }}{{ variable and!=<>|&or 09 ? "string1" : "string2" }}
{{ variable and!=<>|&or "string" ? "string1" : "string2" }}{{ variable and!=<>|&or "string" ? "string1" : "string2" }}