我想将nelmio配置为我的symfony 3项目。我安装了捆绑软件,但最后得到的消息是未定义任何操作! 怎么了有什么想法吗?
/**
* List the rewards of the specified user.
*
* This call takes into account all confirmed awards, but not pending or refused awards.
*
* @Route("/product", name="product", methods={"GET"})
* @SWG\Response(
* response=200,
* description="Returns the rewards of an user",
* @SWG\Schema(
* type="array",
* @SWG\Items(ref=@Model(type=Reward::class, groups={"full"}))
* )
* )
* @SWG\Parameter(
* name="order",
* in="query",
* type="string",
* description="The field used to order rewards"
* )
* @SWG\Tag(name="rewards")
* @Security(name="Bearer")
*
*/
public function getProducts()
{
$product = $this->entityManager->getRepository(Product::class)->getProducts();
$productSerializer = $this->serializer->serialize($product, 'json');
return new JsonResponse($productSerializer);
}