Controller/MailController.php
public function list(Request $request, PaginatorInterface $paginator)
    {
        // Get Query
        $query = $this->getDoctrine()
            ->getRepository($this->getParameter('pd_mailer.mail_template_class'))
            ->createQueryBuilder('m');

        // Get Result
        $pagination = $paginator->paginate(
            $query,
            $request->query->getInt('page', 1),
            $request->query->getInt('limit', $this->getParameter('pd_mailer.list_count'))
        );

        // Set Back URL
        $this->get('session')->set('backUrl', $request->getRequestUri());

        // Render Page
        return $this->render('@PdMailer/list.html.twig', [
            'templates' => $pagination,
            'base_template' => $this->getParameter('pd_mailer.base_template')
        ]);
    }
public function list(Request $request, PaginatorInterface $paginator)
    {
        // Get Query
        $query = $this->getDoctrine()
            ->getRepository($this->getParameter('pd_mailer.mail_template_class'))
            ->createQueryBuilder('m');

        // Get Result
        $pagination = $paginator->paginate(
            $query,
            $request->query->getInt('page', 1),
            $request->query->getInt('limit', $this->getParameter('pd_mailer.list_count'))
        );

        // Set Back URL
        $this->get('session')->set('backUrl', $request->getRequestUri());

        // Render Page
        return $this->render('@PdMailer/list.html.twig', [
            'templates' => $pagination,
            'base_template' => $this->getParameter('pd_mailer.base_template')
        ]);
    }
public function list ( Request $ request , PaginatorInterface $ paginator ) { // Get Query $ query = $ this -> getDoctrine ( ) -> getRepository ( $ this -> getParameter ( 'pd_mailer.mail_template_class' ) ) -> createQueryBuilder ( 'm' ) ; // Get Result $ pagination = $ paginator -> paginate ( $ query , $ request -> query -> getInt ( 'page' , 1 ) , $ request -> query -> getInt ( 'limit' , $ this -> getParameter ( 'pd_mailer.list_count' ) ) ) ; // Set Back URL $ this -> get ( 'session' ) -> set ( 'backUrl' , $ request -> getRequestUri ( ) ) ; // Render Page return $ this -> render ( '@PdMailer/list.html.twig' , [ 'templates' => $ pagination , 'base_template' => $ this -> getParameter ( 'pd_mailer.base_template' ) ] ) ; }
List Mail Templates.

@param Request $request

@IsGranted("ROLE_MAIL_TEMPLATELIST")

@return \Symfony\Component\HttpFoundation\Response
List Mail Templates .