mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-06 15:37:58 +00:00
16 lines
451 B
Plaintext
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
|