@@ -9,6 +9,17 @@ older version of KnpPaginatorBundle - use **v1.0** tag in the repository
9
9
10
10
## Latest updates
11
11
12
+ ** 2012-03-23**
13
+
14
+ - Changed the behavior of customization for query parameters. Etc. now there is no more ** alias**
15
+ for paginations. Instead it will use organized parameter names, which can be set for each pagination
16
+ as different or configured in default global scope, see the [ documentation] ( http://github.com/KnpLabs/KnpPaginatorBundle/blob/master/README.md#configuration )
17
+ and [ upgrade
18
+ guide] ( http://github.com/KnpLabs/KnpPaginatorBundle/blob/master/Resources/doc/upgrade_to_2.2.md )
19
+
20
+ - If you do not wish to migrate to these new changes. Checkout paginator bundle at ** v2.1** tag and
21
+ komponents at ** v1.0**
22
+
12
23
** 2012-03-02**
13
24
14
25
- Added support for [ Solarium] ( http://solarium-project.org ) , a PHP library that handles [ Solr] ( http://lucene.apache.org/solr/ ) search.
@@ -44,7 +55,7 @@ Use the **v1.0** tag of KnpPaginatorBundle if you have to stay compatible with s
44
55
- Separation of conserns, paginator is responsible for generating the pagination view only,
45
56
pagination view - for representation purposes.
46
57
47
- ** Notice :** using multiple paginators requires setting the ** alias** in order to keep non
58
+ ** Note :** using multiple paginators requires setting the ** alias** in order to keep non
48
59
conflicting parameters. Also it gets quite complicated with a twig template, since hash arrays cannot use
49
60
variables as keys.
50
61
@@ -77,25 +88,29 @@ Or if you use [composer](http://packagist.org)
77
88
78
89
{
79
90
require: {
80
- "knplabs/knp-paginator-bundle": "* "
91
+ "knplabs/knp-paginator-bundle": "dev-master "
81
92
}
82
93
}
83
94
95
+ <a name =" configuration " ></a >
96
+
84
97
### Configuration example
85
98
86
- Is it not enough symfony2 configuration? You can override default templates using parameters
99
+ You can configure default query parameter names and templates
87
100
88
101
``` yaml
89
- // File : app/configs/parameters.yml
90
-
91
- parameters :
92
- knp_paginator.template.pagination : MyBundle:Pagination:pagination.html.twig
93
- knp_paginator.template.sortable : MyBundle:Pagination:sortable.html.twig
102
+ knp_paginator :
103
+ page_range : 5 # default page range used in pagination control
104
+ default_options :
105
+ page_name : page # page query parameter name
106
+ sort_field_name : sort # sort field query parameter name
107
+ sort_direction_name : direction # sort direction query parameter name
108
+ distinct : true # ensure distinct results, useful when ORM queries are using GROUP BY statements
109
+ template :
110
+ pagination : KnpPaginatorBundle:Pagination:sliding.html.twig # sliding pagination controls template
111
+ sortable : KnpPaginatorBundle:Pagination:sortable_link.html.twig # sort link template
94
112
` ` `
95
113
96
- Or you can override default config values [this
97
- way](https://github.com/KnpLabs/KnpPaginatorBundle/blob/master/Resources/doc/paginator_configuration.md)
98
-
99
114
### Add the namespaces to your autoloader unless you are using composer
100
115
101
116
` ` ` php
@@ -182,3 +197,4 @@ return compact('pagination');
182
197
[ knp_component_pager ] : https://github.com/KnpLabs/knp-components/blob/master/doc/pager/intro.md " Knp Pager component introduction "
183
198
[ doc_custom_pagination_subscriber ] : https://github.com/KnpLabs/KnpPaginatorBundle/tree/master/Resources/doc/custom_pagination_subscribers.md " Custom pagination subscribers "
184
199
[ doc_templates ] : https://github.com/KnpLabs/KnpPaginatorBundle/tree/master/Resources/doc/templates.md " Customizing Pagination templates "
200
+
0 commit comments