Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include Statement inside jina2 that use a Variable for the included filename

Tags:

jinja2

I am trying to do this:

{% for a in as %}
{% include "{(a}}.jinja"%}
{% endfor %}

But i am getting an Error, that {a}.jinja is Not found. So it seems that it does Not substitude the Variable. Why? How can i fix this?

like image 288
Nathan Avatar asked Nov 22 '16 18:11

Nathan


1 Answers

Inside the {%%} Block, i Can use variables directly. This Works:

{% include a + ".jinja" %}
like image 63
Nathan Avatar answered Sep 21 '22 13:09

Nathan