{%if pager.haveToPaginate%}
    {%if index_route_param is not defined%}{% set index_route_param = {}%}{%endif%}
    {%if ajax is not defined%}{% set ajax = false%}{%endif%}
    <div class="pagination-wrap">
        <ul class="pagination">
            <li class="disabled"><span>(總共: {{pager.nbResults}} 筆)</span></li>
            <li {%if pager.firstPage==pager.page%}class="disabled"{%endif%}><a {%if ajax%}data-ajax="true"{%endif%} href="{{path(index_route, {p: pager.firstPage}|merge(index_route_param))}}">第一頁</a></li>
            <li {%if pager.previousPage==pager.page%}class="disabled"{%endif%}><a {%if ajax%}data-ajax="true"{%endif%} href="{{path(index_route, {p: pager.previousPage}|merge(index_route_param))}}">上一頁</a></li>
            {%if pager.links(10)|first != pager.firstPage%}
            <li><a {%if ajax%}data-ajax="true"{%endif%} href="{{path(index_route, {p: (pager.links(10)|first)-1}|merge(index_route_param))}}">...</a></li>
            {%endif%}
            {%for page in pager.links(10)%}
            <li {%if pager.page == page%}class="active"{%endif%}><a {%if ajax%}data-ajax="true"{%endif%} href="{{path(index_route, {p: page}|merge(index_route_param))}}">{{page}}</a></li>
            {%endfor%}
            {%if pager.links(10)|last != pager.lastPage%}
            <li><a {%if ajax%}data-ajax="true"{%endif%} href="{{path(index_route, {p: (pager.links(10)|last)+1}|merge(index_route_param))}}">...</a></li>
            {%endif%}
            <li {%if pager.nextPage==pager.page%}class="disabled"{%endif%}><a {%if ajax%}data-ajax="true"{%endif%} href="{{path(index_route, {p: pager.nextPage}|merge(index_route_param))}}">下一頁</a></li>
            <li {%if pager.lastPage==pager.page%}class="disabled"{%endif%}><a {%if ajax%}data-ajax="true"{%endif%} href="{{path(index_route, {p: pager.lastPage}|merge(index_route_param))}}">最後一頁</a></li>
            <li class="disabled"><span>{{pager.page}}/{{pager.lastPage}}</span></li>
        </ul>
    </div>
{%endif%}