Sha*_*ade 7 symfony twitter-bootstrap knppaginator

我正在尝试将twitter bootstrap css样式应用到我的knp分页而不修改供应商.
有没有办法配置KnpPaginator以检测现有的bootstrap css样式表?因为截图显示,它是使用bootstrap构建的.
Sha*_*ade 22
@Derick F:非常感谢你,我找到了另一种方式:
我刚刚换下:
pagination: KnpPaginatorBundle:Pagination:sliding.html.twig
Run Code Online (Sandbox Code Playgroud)
同
pagination: KnpPaginatorBundle:Pagination:twitter_bootstrap_v3_pagination.html.twig
Run Code Online (Sandbox Code Playgroud)
它是knp bundle中包含的默认模板.
是的,在您config.yml和您的knp_paginator设置中:
knp_paginator:
template:
pagination: AcmeBundle:Common:paginator-bootstrap.html.twig
Run Code Online (Sandbox Code Playgroud)
然后在 paginator-bootstrap.html.twig
{% if pageCount > 1 %}
<ul class="pagination">
{% if first is defined and current != first %}
<li class="first"><a href="{{ path(route, query|merge({(pageParameterName): first})) }}"><<</a></li>
{% endif %}
{% if previous is defined %}
<li class="previous"><a class="hidden-xs" href="{{ path(route, query|merge({(pageParameterName): previous})) }}"><</a></li>
{% endif %}
{% for page in pagesInRange %}
{% if page != current %}
<li class="page"><a href="{{ path(route, query|merge({(pageParameterName): page})) }}">{{ page }}</a></li>
{% else %}
<li class="current active"><a>{{ page }} <span class="sr-only">(current)</span></a></li>
{% endif %}
{% endfor %}
{% if next is defined %}
<li class="next"><a class="hidden-xs" href="{{ path(route, query|merge({(pageParameterName): next})) }}">></a></li>
{% endif %}
{% if last is defined and current != last %}
<li class="last"><a href="{{ path(route, query|merge({(pageParameterName): last})) }}">>></a></li>
{% endif %}
</ul>
{% endif %}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7312 次 |
| 最近记录: |