是否有限制Pagerfanta分页中页码数量的配置?
Is there an configuration to limit the numbers of page numbers in Pagerfanta pagination?
我用 Pagerfanta 做了一个分页。我想将页码限制为 5,因为在移动版本上分页太大。我使用的是默认视图 'twitter_bootstrap_translated'.
{% if articles.haveToPaginate %}
<div class="pagination-class">
{{ pagerfanta(articles, 'twitter_bootstrap_translated', {routeName: 'search_result_paginated', routeParams: app.request.query.all}) }}
</div>
{% endif %}
如何限制页面numbers/links?
当前:<上一页 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | ... 101 |下一步 >
我需要这样的分页:
当前: < 上一页 | 1 | 2 | 3 | ... 101 |下一步 >
看看可能有用:
<?php
use Pagerfanta\View\TwitterBootstrapView;
$view = new TwitterBootstrapView();
$options = array('proximity' => 3);
$html = $view->render($pagerfanta, $routeGenerator, $options);
Options (default):
proximity (3)
prev_message (← Previous)
prev_disabled_href ()
next_message (Next →)
next_disabled_href ()
dots_message (…)
dots_href ()
css_container_class (pagination)
css_prev_class (prev)
css_next_class (next)
css_disabled_class (disabled)
css_dots_class (disabled)
css_active_class (active)
我用 Pagerfanta 做了一个分页。我想将页码限制为 5,因为在移动版本上分页太大。我使用的是默认视图 'twitter_bootstrap_translated'.
{% if articles.haveToPaginate %}
<div class="pagination-class">
{{ pagerfanta(articles, 'twitter_bootstrap_translated', {routeName: 'search_result_paginated', routeParams: app.request.query.all}) }}
</div>
{% endif %}
如何限制页面numbers/links?
当前:<上一页 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | ... 101 |下一步 >
我需要这样的分页: 当前: < 上一页 | 1 | 2 | 3 | ... 101 |下一步 >
看看可能有用:
<?php
use Pagerfanta\View\TwitterBootstrapView;
$view = new TwitterBootstrapView();
$options = array('proximity' => 3);
$html = $view->render($pagerfanta, $routeGenerator, $options);
Options (default):
proximity (3)
prev_message (← Previous)
prev_disabled_href ()
next_message (Next →)
next_disabled_href ()
dots_message (…)
dots_href ()
css_container_class (pagination)
css_prev_class (prev)
css_next_class (next)
css_disabled_class (disabled)
css_dots_class (disabled)
css_active_class (active)