Files
Twig/tests/Fixtures/functions/template_from_string.test
2019-06-30 14:48:27 +02:00

16 lines
451 B
Plaintext

--TEST--
"template_from_string" function
--TEMPLATE--
{% include template_from_string(template) %}
{% include template_from_string("Hello {{ name }}") %}
{% include template_from_string('{% extends "parent.twig" %}{% block content %}Hello {{ name }}{% endblock %}') %}
--TEMPLATE(parent.twig)--
{% block content %}{% endblock %}
--DATA--
return ['name' => 'Fabien', 'template' => "Hello {{ name }}"]
--EXPECT--
Hello Fabien
Hello Fabien
Hello Fabien