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