我有一个 Symfony 3.4 项目,我在探查器中发现了以下消息:
我花了一些时间寻找解决方案,但没有发现任何真正有用的东西。
一些发现 here或 here .
最佳答案
替换这个:
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
class UserController
{
/**
* @Route("/users")
* @Method("GET")
*/
public action index()
{}
有了这个:
use Symfony\Component\Routing\Annotation\Route;
class UserController
{
/**
* @Route(path="/users", methods={"GET"})
*/
H/T 这家伙 -> https://medium.com/@nebkam/symfony-deprecated-route-and-method-annotations-4d5e1d34556a
关于symfony - 如何修复 Symfony 3.4 @Route 和 @Method 弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51171934/