1. Go to this page and download the library: Download tangoman/repository-helper 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/ */
tangoman / repository-helper example snippets
namespace FoobarBundle\Repository;
use Doctrine\ORM\EntityRepository;
use TangoMan\RepositoryHelper\RepositoryHelper;
/**
* Class FoobarRepository
*/
class FoobarRepository extends EntityRepository
{
use RepositoryHelper;
}
use Symfony\Component\HttpFoundation\Request;
class FoobarController extends Controller
{
/**
* @Route("/")
*/
public function indexAction(Request $request)
{
// Show searchable, sortable, paginated user list
$em = $this->get('doctrine')->getManager();
$foobars = $em->getRepository('AppBundle:Foobar')->findByQuery($request);
return $this->render(
'admin/foobar/index.html.twig',
[
'foobars' => $foobars,
]
);
}