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.     <div
  10.         class="mx-auto mt-20 flex w-[46rem] justify-center gap-6 md:gap-3 px-6 md:w-full  text-sm leading-normal">
  11.         {# 最初へ #}
  12.         {% if pages.firstPageInRange != 1 %}
  13.             <a href="{{ path( app.request.attributes.get('_route'), app.request.query.all|merge({'pageno': pages.first})) }}" class="grid size-9 place-items-center rounded-full border">1</a>
  14.         {% endif %}
  15.         {# 1ページリンクが表示されない場合、「...」を表示 #}
  16.         {% if pages.firstPageInRange != 1 %}
  17.             <p class="grid place-items-center">...</p>
  18.         {% endif %}
  19.         {% for page in pages.pagesInRange %}
  20.             {% if page == pages.current %}
  21.                 <a href="{{ path( app.request.attributes.get('_route'), app.request.query.all|merge({'pageno': page})) }}" class="grid size-9 place-items-center rounded-full border bg-black text-white">
  22.                     {{ page }}
  23.                 </a>
  24.             {% else %}
  25.                 <a href="{{ path( app.request.attributes.get('_route'), app.request.query.all|merge({'pageno': page})) }}" class="grid size-9 place-items-center rounded-full border">
  26.                     {{ page }}
  27.                 </a>
  28.             {% endif %}
  29.         {% endfor %}
  30.         {# 最終ページリンクが表示されない場合、「...」を表示 #}
  31.         {% if pages.last != pages.lastPageInRange %}
  32.             <p class="grid place-items-center">...</p>
  33.         {% endif %}
  34.         {# 最後へ #}
  35.         {% if pages.last != pages.lastPageInRange %}
  36.             <a href="{{ path( app.request.attributes.get('_route'), app.request.query.all|merge({'pageno': pages.last})) }}" class="grid size-9 place-items-center rounded-full border">
  37.                 {{ pages.last }}</a>
  38.         {% endif %}
  39.     </div>
  40. {% endif %}