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