-1
public function searchAction(Request $request)
{
$em = $this->getDoctrine()->getEntityManager();
$searchName = $request->query->get('search_name');
$searches= \explode(' ', $searchName);
$search = $em->createQueryBuilder()->select('c')
->from('SavvyContactBundle:Contact', 'c')
->where("c.name = :name")
->setParameter('name', $searchName)
->addOrderBy('c.id', 'DESC')
->getQuery();
return $this->render('SavvyContactBundle:Contact:list.html.twig', array('search' => $search, 'searches' => $searches));
}
這是特定的單詞基本的搜索,我想做出這樣的搜索,其估算在輸入欄,請幫助,讓我知道如果我錯了地方的每一個字高級搜索。高級搜索
請問您能給我一些反饋嗎? – coma
對不起,我忘了你,但你的代碼工作謝謝 – craig