public function get_search_form($form) { // because first time it's action if (!empty($form)) { /** @var \Twig_Environment $twig */ $twig = $this['twig.environment']; return $twig->render('searchform.twig', array()); } return $form; }