PHP code example of dimmir / paginator-bundle

1. Go to this page and download the library: Download dimmir/paginator-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dimmir / paginator-bundle example snippets


// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new DMR\Bundle\PaginatorBundle\PaginatorBundle(),
        // ...
    );
}

// AppBundle\Controller\UserController.php

    /**
     * @View()
     */
    public function cgetAction (Request $request)
    {
        $queryBuilder = $this->getDoctrine()->getManager()
                    ->getRepository('AppBundle:User')->createQueryBuilder('u');

        $paginator = $this->get('dmr_paginator.service')->pagination($queryBuilder);

        return new SliderRepresentation($paginator);
    }