diff --git a/Controller/SearchController.php b/Controller/SearchController.php index 63439e8ce..1ae8dc158 100644 --- a/Controller/SearchController.php +++ b/Controller/SearchController.php @@ -45,7 +45,8 @@ class SearchController extends Controller return $this->render('ChillMainBundle:Search:error.html.twig', array( 'message' => $this->get('translator')->trans("Your search is empty. " - . "Please provide search terms.") + . "Please provide search terms."), + 'pattern' => $pattern )); } @@ -64,7 +65,8 @@ class SearchController extends Controller return $this->render('ChillMainBundle:Search:error.html.twig', array( "message" => $this->get('translator')->trans("The domain %domain% " - . "is unknow. Please check your search.", array('%domain%' => $ex->getDomain())) + . "is unknow. Please check your search.", array('%domain%' => $ex->getDomain())), + 'pattern' => $pattern )); } catch (UnknowSearchNameException $ex) { throw $this->createNotFoundException("The name ".$ex->getName()." is not found"); @@ -72,13 +74,14 @@ class SearchController extends Controller return $this->render('ChillMainBundle:Search:error.html.twig', array( "message" => $this->get('translator')->trans('Invalid terms'). - ": ".$this->get('translator')->trans($ex->getMessage()) + ": ".$this->get('translator')->trans($ex->getMessage()), + 'pattern' => $pattern )); } return $this->render('ChillMainBundle:Search:list.html.twig', - array('results' => $results) + array('results' => $results, 'pattern' => $pattern) ); } diff --git a/Resources/views/Search/error.html.twig b/Resources/views/Search/error.html.twig index 690d40de9..b16c84f8b 100644 --- a/Resources/views/Search/error.html.twig +++ b/Resources/views/Search/error.html.twig @@ -16,6 +16,8 @@ #} {% extends "ChillMainBundle::layout.html.twig" %} +{% set _search_pattern = pattern %} + {% block content %}
{{ message }}
diff --git a/Resources/views/Search/list.html.twig b/Resources/views/Search/list.html.twig index 0f633263f..3404880e4 100644 --- a/Resources/views/Search/list.html.twig +++ b/Resources/views/Search/list.html.twig @@ -16,6 +16,8 @@ #} {% extends "ChillMainBundle::layout.html.twig" %} +{% set _search_pattern = pattern %} + {% block content %} {% for result in results %} diff --git a/Resources/views/layout.html.twig b/Resources/views/layout.html.twig index 6ed6b7d8b..189c9b6d4 100644 --- a/Resources/views/layout.html.twig +++ b/Resources/views/layout.html.twig @@ -33,7 +33,7 @@