app/template/default/pager.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% if pageinrange is defined %}
  9.     {% set pageinrange  = pageinrange %}
  10. {% else  %}
  11.     {% set pageinrange  = false %}
  12. {% endif %}
  13. {% if pages.pageCount > 1 %}
  14. <div id="pagination_wrap" class="pagination">
  15.     <ul>
  16.         {% if pageinrange and pages.firstPageInRange != 1 %}
  17.             {# 最初へリンクを表示 #}
  18.             <li class="pagenation__item-first">
  19.                 <a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'pageno': pages.first})) }}"
  20.                    aria-label="First"><span aria-hidden="true">最初へ</span></a>
  21.             </li>
  22.         {% endif %}
  23.         {% if pages.previous is defined %}
  24.             <li class="pagenation__item-previous">
  25.                 <a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'pageno': pages.previous})) }}"
  26.                    aria-label="Previous"><span aria-hidden="true">前へ</span></a>
  27.             </li>
  28.         {% endif %}
  29.         {% if pageinrange and pages.firstPageInRange != 1 %}
  30.             {# 1ページリンクが表示されない場合、「...」を表示 #}
  31.             <li>...</li>
  32.         {% endif %}
  33.         {% for page in pages.pagesInRange %}
  34.             {% if page == pages.current %}
  35.                 <li class="pagenation__item active"><a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'pageno': page})) }}"> {{ page }} </a></li>
  36.             {% else %}
  37.                 <li class="pagenation__item"><a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'pageno': page})) }}"> {{ page }} </a></li>
  38.             {% endif %}
  39.         {% endfor %}
  40.         {% if pageinrange and pages.last != pages.lastPageInRange %}
  41.             {# 最終ページリンクが表示されない場合、「...」を表示 #}
  42.             <li>...</li>
  43.         {% endif %}
  44.         {% if pages.next is defined %}
  45.             <li class="pagenation__item-next">
  46.                 <a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'pageno': pages.next})) }}"
  47.                    aria-label="Next"><span aria-hidden="true">次へ</span></a>
  48.             </li>
  49.         {% endif %}
  50.         {% if pageinrange and pages.last != pages.lastPageInRange %}
  51.             {# 最後へリンクを表示 #}
  52.             <li class="pagenation__item-last">
  53.                 <a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'pageno': pages.last})) }}"
  54.                    aria-label="Last"><span aria-hidden="true">最後へ</span></a>
  55.             </li>
  56.         {% endif %}
  57.     </ul>
  58. </div>
  59. {% endif %}