2017 © Pedro Peláez
 

symfony-bundle filternator-bundle

Bundle to use knp paginator bundle and lexik form filter bundle

image

tmsolution/filternator-bundle

Bundle to use knp paginator bundle and lexik form filter bundle

  • Tuesday, June 28, 2016
  • by JacekLozinski
  • Repository
  • 0 Watchers
  • 0 Stars
  • 105 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Filter-Nator

This bundle is a simple link between the KnpPaginatorBundle and the [LexikFormFilterBundle][2] allowing entities to be filtered (Filter) and paginated (Nator)., (*1)

Installation

Step 1

Add the Filter-Nator bundle as a dependency in your composer.json:, (*2)

{
    require: {
        "savvy/filternator-bundle": "dev-master"
    }
}

Step 2

Update the dependecies using composer:, (*3)

$ php composer.phar update

Step 3

Add the Filter-Nator bundle to the AppKernal.php file:, (*4)

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            //...
            new Savvy\FilterNatorBundle\SavvyFilterNatorBundle(),

Usage

The Filter-Nator bundle has one method, filterNate(). This method requires a query builder object, a filter form and a unique string to be used to store the form data in the session. The returned value is the pagination object from the KnpPaginatorBundle:, (*5)

//Any class with access to the ContainerInterface object
$pagination = $this->container->get("savvy.filter_nator")->filterNate($filterBuilder, $form, 'foo');

Options

There are two additional arguments that can be given to filterNate() to set the required number of entites to return and the page number to start on:, (*6)

//Any class with access to the ContainerInterface object
$pagination = $this->container->get("savvy.filter_nator")->filterNate(
    $filterBuilder,
    $form,
    'foo',
    5, /*return 5 entities*/
    1  /*starting from page 1*/
);

The Versions

28/06 2016

dev-master

9999999-dev http://github.com/oxygenthinking/FilterNatorBundle.git

Bundle to use knp paginator bundle and lexik form filter bundle

  Sources   Download

MIT

The Requires

 

filter paginate