yogthos/Selmer

Parameters in include

開放

#90 建立於 2015年7月27日

 (1 則留言) (0 個反應) (0 位負責人)Clojure (121 個分叉)batch import
enhancementhelp wanted

倉庫指標

星標
 (1,042 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Hello, I am trying to use an include tag when passing parameters as follows

{% include "views/pagination.html" with controller="users" %}

While getting the value of the parameter controller works with {{}} syntax, it does not seem to be in the context-map and thus is not usable in custom tags in the partial ("views/pagination.html" in my case).

My current solution is rather ugly

{% with controller=controller|default:"users" %}
  {% include "views/pagination.html" %}
{% endwith %}

so I would like to know if there is a better way to do something like that or will it be very difficult for me to implement it?

Note: This might be related to #78.

貢獻者指南