PHP code example of agusmoita / mottapg-bundle

1. Go to this page and download the library: Download agusmoita/mottapg-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/ */

    

agusmoita / mottapg-bundle example snippets


    use MottaPgBundle\Util\Paginator\Paginator;
    
    /**
     * @Route("/", name="person_index", methods={"GET|POST"})
     */
    public function indexAction(Paginator $pg, PersonRepository $repo)
    {
        return $pg
                ->setView('person/index.html.twig')
                ->paginate($repo);
    }
    

    // PersonRepository.php
    
    public function buildQuery($query, $pg)
    {
        // return SELECT a FROM AppBundle:Person a
        return $query;
    }