Developers

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Release 1.0.2 - 07/05/2010

Release 1.0.1 - 06/05/2010

sfPaginationPlugin plugin

The sfPaginationPlugin is a symfony plugin that provides a better and
a easy way to use pagination in symfony.

It manages pagination and also generates a table for pagination navigation.

Installation

Install the plugin

$ symfony plugin:install sfPaginationPlugin

Enable one or more modules in your settings.yml (optional)

For general use: sfPaginationPlugin

all:
.settings:
enabled_modules: [default, sfPaginationPlugin]

Clear you cache

$ symfony cc

Configure the CSS classes of the rendered pagination in /plugins/sfPaginationPlugin/config/app.yml:

all:
sfPaginationPlugin:
#class of parent UL
ul_class: pagination-flickr
#class of li for next button
li_next: next
#class of li for previous button
li_prev: previous
#class of li for active page button
li_active: active
#class of li for normal page button
li: ''
#default number of entries per page
default_entries: 20
#a list of all available option for entrie per page
entries_per_page: [20,60,80,100]

Using in you application

Create pagination in action:

Using Propel Criteria:

$c = new Criteria();
// This function requires the following parameters// First: Criteria of selection// Second: The Peer class/table from which we select// Third: The request variable of the action where we run it$pgr = new sfPaginationPlugin($c, 'Posts', $request, sfPaginationClass);
// We set the URL to which all our pages will point to$pgr->setAction('posts/index');
// We set the number of entries per page$pgr->setEntries(20);
// We run the query and do the pagination$pgr->Run();
// We send the result to the template$this->pgr = $pgr;