Twig文件中的jQuery QueryBuilder doT.js模板语法

时间:2018-07-31 12:11:40

标签: twig dot.js jquery-query-builder

我尝试像这样重写规则模板:

$(queryBuilderId).queryBuilder({
         templates: {
                rule: '\
                    <div id="{{= it.rule_id }}" class="rule-container"> \
                          <div class="rule-header"> \
                                <div class="btn-group pull-right rule-actions"> \
                                     <button type="button" class="btn btn-xs btn-danger" data-delete="rule"> \
                                         <i class="{{= it.icons.remove_rule }}"></i> {{= it.translate("delete_rule") }} \
                                     </button> \
                               </div> \
                         </div> \
                         {{? it.settings.display_errors }} \
                            <div class="error-container"><i class="{{= it.icons.error }}"></i></div> \
                         {{?}} \
                         <div class="rule-filter-container"></div> \
                         <div class="rule-operator-container"></div> \
                         <div class="rule-value-container"></div> \
                   </div>'
        }
})

我已经在头文件中包含了doT.js,但是树枝引发了这个错误: Unexpected token "operator" of value "=".

有人知道我如何在树枝文件中使用doT.js模板语法吗?

0 个答案:

没有答案