src/Eccube/Resource/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 pages.pageCount > 1 %}
  9.     <ul class="ec-pager">
  10.         {# 最初へ #}
  11.         {% if pages.firstPageInRange != 1 %}
  12.             <li class="ec-pager__item">
  13.                 <a href="{{ path(
  14.                 app.request.attributes.get('_route'),
  15.                 app.request.query.all|merge({'pageno': pages.first})) }}">{{ '最初へ'|trans }}</a></li>
  16.         {% endif %}
  17.         {# 前へ #}
  18.         {% if pages.previous is defined %}
  19.             <li class="ec-pager__item">
  20.                 <a href="{{ path(
  21.                 app.request.attributes.get('_route'),
  22.                 app.request.query.all|merge({'pageno': pages.previous})) }}">{{ '前へ'|trans }}</a></li>
  23.         {% endif %}
  24.         {# 1ページリンクが表示されない場合、「...」を表示 #}
  25.         {% if pages.firstPageInRange != 1 %}
  26.             <li class="ec-pager__item">...</li>
  27.         {% endif %}
  28.         {% for page in pages.pagesInRange %}
  29.             {% if page == pages.current %}
  30.                 <li class="ec-pager__item--active"><a href="{{ path(
  31.                     app.request.attributes.get('_route'),
  32.                     app.request.query.all|merge({'pageno': page})) }}"> {{ page }} </a></li>
  33.             {% else %}
  34.                 <li class="ec-pager__item"><a href="{{ path(
  35.                     app.request.attributes.get('_route'),
  36.                     app.request.query.all|merge({'pageno': page})) }}"> {{ page }} </a></li>
  37.             {% endif %}
  38.         {% endfor %}
  39.         {# 最終ページリンクが表示されない場合、「...」を表示 #}
  40.         {% if pages.last != pages.lastPageInRange %}
  41.             <li class="ec-pager__item">...</li>
  42.         {% endif %}
  43.         {# 次へ #}
  44.         {% if pages.next is defined %}
  45.             <li class="ec-pager__item">
  46.                 <a href="{{ path(
  47.                 app.request.attributes.get('_route'),
  48.                 app.request.query.all|merge({'pageno': pages.next})) }}">{{ '次へ'|trans }}</a></li>
  49.         {% endif %}
  50.         {# 最後へ #}
  51.         {% if pages.last != pages.lastPageInRange %}
  52.             <li class="ec-pager__item">
  53.                 <a href="{{ path(
  54.                 app.request.attributes.get('_route'),
  55.                 app.request.query.all|merge({'pageno': pages.last})) }}">{{ '最後へ'|trans }}</a></li>
  56.         {% endif %}
  57.     </ul>
  58. {% endif %}