tadcka/paginator-bundle

Manager pagination on Symfony2

Installs: 256

Dependents: 3

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

v0.1.0 2014-03-27 20:32 UTC

This package is not auto-updated.

Last update: 2024-04-23 00:03:51 UTC


README

Paginator bundle.

Installation

Step 1: Download TadckaPaginatorBundle using composer

Add TadckaPaginatorBundle in your composer.json:

{
    "require": {
        "tadcka/paginator-bundle": "dev-master"
    }
}

Now tell composer to download the bundle by running the command:

$ php composer.phar update tadcka/paginator-bundle

Step 2: Enable the bundle

Enable the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Tadcka\PaginatorBundle\TadckaPaginatorBundle(),
    );
}

How use?

Step 3: How use?

Create pagination object:

<?php
$pagination = new \Tadcka\Component\Paginator\Pagination($totalItems, $currentPage, $itemsPerPage);

Render html:

<?php
$paginationHtml = $this->container->get('tadcka_paginator.manager')->getPaginatorHtml($pagination);

Step 4: Configuration

tadcka_paginator:
  max_near_pages: 3
  template_class:
    pagination: test
    pagination_links: test_links
    pagination_link: test_link