public function searchRouteAction( $context )
    {
        /** @var SearchAdapter $searchAdapter */
        $searchAdapter = $this->get('netgen_search_and_filter.route_'.$context);

        /** @var Form $form */
        $form = $searchAdapter->getForm();

        $response = new Response();

        $pager = new Pagerfanta( $searchAdapter );
        $pager->setMaxPerPage( $searchAdapter->getPageLimit() );

        $showResults = $this->getPage( $pager, $form );

        $request = $this->container->get('request');

        return $this->render($searchAdapter->getResultTemplate(), array(
            'pagelayout' => $this->container->getParameter("netgen_search_and_filter.main_pagelayout"),
            'route' => $request->get('_route'),
            'context' => $context,
            'form_template' => $searchAdapter->getFormTemplate(),
            'form' => $form->createView(),
            'pager' => $pager,
            'show_results' => $showResults,
            'query_string' => array($form->getName() => $form->getData()),
            'current_locale' => $this->getConfigResolver()->getParameter('RegionalSettings.Locale')
        ), $response);
    }
public function searchRouteAction( $context )
    {
        /** @var SearchAdapter $searchAdapter */
        $searchAdapter = $this->get('netgen_search_and_filter.route_'.$context);

        /** @var Form $form */
        $form = $searchAdapter->getForm();

        $response = new Response();

        $pager = new Pagerfanta( $searchAdapter );
        $pager->setMaxPerPage( $searchAdapter->getPageLimit() );

        $showResults = $this->getPage( $pager, $form );

        $request = $this->container->get('request');

        return $this->render($searchAdapter->getResultTemplate(), array(
            'pagelayout' => $this->container->getParameter("netgen_search_and_filter.main_pagelayout"),
            'route' => $request->get('_route'),
            'context' => $context,
            'form_template' => $searchAdapter->getFormTemplate(),
            'form' => $form->createView(),
            'pager' => $pager,
            'show_results' => $showResults,
            'query_string' => array($form->getName() => $form->getData()),
            'current_locale' => $this->getConfigResolver()->getParameter('RegionalSettings.Locale')
        ), $response);
    }
public function searchRouteAction ( $ context ) { /** @var SearchAdapter $searchAdapter */ $ searchAdapter = $ this -> get ( 'netgen_search_and_filter.route_' . $ context ) ; /** @var Form $form */ $ form = $ searchAdapter -> getForm ( ) ; $ response = new Response ( ) ; $ pager = new Pagerfanta ( $ searchAdapter ) ; $ pager -> setMaxPerPage ( $ searchAdapter -> getPageLimit ( ) ) ; $ showResults = $ this -> getPage ( $ pager , $ form ) ; $ request = $ this -> container -> get ( 'request' ) ; return $ this -> render ( $ searchAdapter -> getResultTemplate ( ) , array ( 'pagelayout' => $ this -> container -> getParameter ( "netgen_search_and_filter.main_pagelayout" ) , 'route' => $ request -> get ( '_route' ) , 'context' => $ context , 'form_template' => $ searchAdapter -> getFormTemplate ( ) , 'form' => $ form -> createView ( ) , 'pager' => $ pager , 'show_results' => $ showResults , 'query_string' => array ( $ form -> getName ( ) => $ form -> getData ( ) ) , 'current_locale' => $ this -> getConfigResolver ( ) -> getParameter ( 'RegionalSettings.Locale' ) ) , $ response ) ; }
Action for rendering search page for Route
Action for rendering search page for Route