PHP code example of thomasdcodes / list-view-bundle

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

    

thomasdcodes / list-view-bundle example snippets


use Tdc\ListViewBundle\Factory;

public function __invoke(Request $request): JsonResponse
{
    $listControl = ListControlFactory::createFromRequest(Request $request);
}

// A Method inside your controller
public function __invoke(): Response
{
    $listControl = ListControlFactory::createFromRequest(Request $request);
    
    // Make a query with your $listControl
    $result = $this->personRepository->loadWithListControl($listControl);
    
    $listControl->getPaginator()->setTotal($result->numberOfResults());
    
    //………
}

limit