0

我在我的项目中集成了 knp 包,但是分页器的按钮是这样的

在此处输入图像描述

我怎样才能使按钮像我的模板中一样

在此处输入图像描述

<div id="blog_pagination" class="pagination pagination-centered clearfix">
                    <a class="next page-numbers" href="#"><i class="ci_icon-chevron-left"></i></a>
                    <span class="page-numbers current">1</span>
                    <a class="page-numbers" href="#">2</a>
                    <a class="next page-numbers" href="#"><i class="ci_icon-chevron-right"></i></a>
                </div>
4

1 回答 1

4

根据文档,在配置文件中:

// app/config/config.yml

knp_paginator:
        page_range: 5                      # default page range used in pagination control
        default_options:
            page_name: page                # page query parameter name
            sort_field_name: sort          # sort field query parameter name
            sort_direction_name: direction # sort direction query parameter name
            distinct: true                 # ensure distinct results, useful when ORM queries are using GROUP BY statements
        template:
            pagination: KnpPaginatorBundle:Pagination:sliding.html.twig     # sliding pagination controls template
            sortable: KnpPaginatorBundle:Pagination:sortable_link.html.twig # sort link template

更改 boostrap 模板的默认模板:

pagination: KnpPaginatorBundle:Pagination:sliding.html.twig 

对于(自举 3)

pagination: KnpPaginatorBundle:Pagination:twitter_bootstrap_v3_pagination.html.twig

或(自举 1 和 2)

pagination: KnpPaginatorBundle:Pagination:twitter_bootstrap_pagination.html.twig
于 2016-11-28T16:26:50.273 回答