src/PHPDish/Bundle/ForumBundle/Controller/ThreadController.php
public function autoCompleteAction(Request $request)
    {
        $query = $request->query->get('query');
        $threads = $this->getThreadManager()->searchThreads($query);
        return $this->json([
            'threads' => $threads
        ]);
    }
public function autoCompleteAction(Request $request)
    {
        $query = $request->query->get('query');
        $threads = $this->getThreadManager()->searchThreads($query);
        return $this->json([
            'threads' => $threads
        ]);
    }
自动完成获取数据
@Route("/threads/autocomplete", name="thread_autocomplete")
@param Request $request
@return Response