无法解析剩余部分 [英] Could not parse the remainder

查看:80
本文介绍了无法解析剩余部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想比较num和{{buildSummary_list.number}},但是为什么不起作用?
而且我遇到了错误

i want to compare num and {{buildSummary_list.number}}, but why it is not work? And i got an error

Could not parse the remainder: '{{buildSummary_list.number}}' from '{{buildSummary_list.number}}'"...







{% for num in buildSummary_list.paginator.page_range %}
    {% ifequal num {{buildSummary_list.number}} %}
        <b>{{num}}</b>
    {% endifequal %}
    {% ifnotequal num {{buildSummary_list.number}} %}
        <a href="?page={{num}}"><b>{{num}}</b></a>
    {% endifnotequal %}

{% endfor %}

我想使分页生效:
pre<< <1 2 3 4 5 6 >>下一个

I want to make the pagination have effect: pre << 1 2 3 4 5 6 >> next

我的代码可以运行了,能起到这种作用吗?
谢谢:D

I my code can run, can it make this effect? thanks:D

推荐答案

{%%} 标记内,变量没有被 {{。尝试以下操作:

Inside a {% %} tag, variables aren't surrounded by {{. Try this:

{% ifequal num buildSummary_list.number %}

另外,看起来您的两个比较可以与else一起加入:

Also, it looks like your two comparisons can be joined with an else:

{% for num in buildSummary_list.paginator.page_range %}
    {% ifequal num buildSummary_list.number %}
        <b>{{num}}</b>
    {% else %}
        <a href="?page={{num}}"><b>{{num}}</b></a>
    {% endifequal %}
{% endfor %}

这篇关于无法解析剩余部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆