src/Controller/MainController.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Form\SearchFormType;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. class MainController extends AbstractController
  7. {
  8.     /**
  9.      * @Route("/", name="main")
  10.      */
  11.     public function index()
  12.     {
  13.         return $this->render('main/index.html.twig', [
  14.             'controller_name' => 'MainController',
  15.         ]);
  16.     }
  17.     public function getSearchForm($request){
  18.         $form $this->createForm(SearchFormType::class, ($request['search_form'] ?? null));
  19.         return $this->render('bundles/KnpPaginator/filter.html.twig', [
  20.             'form' => $form->createView(),
  21.         ]);
  22.     }
  23. }