Closed ybensacq closed 8 years ago
another problem
public function searchBookAction(Request $request)
{
// the following line should be
$q = $request->get('q');
// instead of
// $q = $request->get('term');
$em = $this->getDoctrine()->getManager();
$results = $em->getRepository('AppBundle:Book')->findLikeName($q);
return array('results' => $results);
}
For beginners, I think the following lines are insufficient :
Why not add the following annotation : * @Template(":folder:city.html.twig") or rendering a template like they said in best practices ? :)