Algolia search/Symfony:函数参数太少
Algolia search/Symfony :Too few arguments to function
尝试使用 Algolia 进行简单搜索时。搜索方法将查询 Algolia 以获得匹配结果,然后将创建一个学说集合。我收到此错误:
我在控制器中注入了 indexManager :
class ProductController extends Controller
{
protected $indexManager;
public function __construct(IndexManagerInterface $indexingManager)
{
$this->indexManager = $indexingManager;
}
public function displayAction(Request $request) {
$em = $this->getDoctrine()->getManagerForClass(Product::class);
$posts = $this->indexManager->search('query', Product::class, $em);
return $this->render('ProductBundle:Default:postDisplay.html.twig', array(
'posts' => $posts));
}
}
你能确定 autowire
功能设置为 true
吗?
https://symfony.com/doc/current/service_container/autowiring.html
Symfony 应该会自动解决依赖关系。
尝试使用 Algolia 进行简单搜索时。搜索方法将查询 Algolia 以获得匹配结果,然后将创建一个学说集合。我收到此错误:
我在控制器中注入了 indexManager :
class ProductController extends Controller
{
protected $indexManager;
public function __construct(IndexManagerInterface $indexingManager)
{
$this->indexManager = $indexingManager;
}
public function displayAction(Request $request) {
$em = $this->getDoctrine()->getManagerForClass(Product::class);
$posts = $this->indexManager->search('query', Product::class, $em);
return $this->render('ProductBundle:Default:postDisplay.html.twig', array(
'posts' => $posts));
}
}
你能确定 autowire
功能设置为 true
吗?
https://symfony.com/doc/current/service_container/autowiring.html
Symfony 应该会自动解决依赖关系。