Guest User

Untitled

a guest
Sep 6th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. /**
  2.  *
  3.  * @Route("/search")
  4.  */
  5. class SearchController extends Controller
  6. {
  7.     /**
  8.      * @Route("/{search}")
  9.      */
  10.     public function indexAction($search)
  11.     {
  12.         echo $search;
  13.        
  14.         // replace this example code with whatever you need
  15.         return $this->render('default/index.html.twig', [
  16.             'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..'),
  17.         ]);
  18.     }
  19.  
  20.     /**
  21.      * Read Notification entitie.
  22.      *
  23.      * @Route("/generate", name="search.generate" )
  24.      * @Template(":menu:search.html.twig")
  25.      */
  26.     public function generateAction()
  27.     {
  28.         $form = $this->createForm(SearchType::class, [], [
  29.             'action' => $this->generateUrl('search.index', []),
  30.             'method' => 'GET'
  31.         ]);
  32.  
  33.  
  34.         return ['form' => $form->createView() ];
  35.     }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment