{% include "example.html" with name="John" hide_last_name=True %}
基本上,我试图在我的主模板中包含“example.html”作为子模板。附加上下文提供了传递关键字参数name
和hide_last_name
的意思。虽然Django模板系统没有任何问题可以识别name
,但它无法识别hide_last_name
。我怀疑现在允许在Include
标记中使用布尔关键字参数,但是在官方文档中我找不到任何地方提及这一点。请帮忙。谢谢。如何传递布尔关键字参数以及使用“Include”模板标记
怀疑,但无法确定。感谢您的确认。 – tamakisquare 2012-08-04 08:34:47