gpt4 book ai didi

php - 什么是语义错误 Symfony2

转载 作者:可可西里 更新时间:2023-11-01 00:33:44 25 4
gpt4 key购买 nike

我收到这个错误

[Doctrine\Common\Annotations\AnnotationException]                            
[Semantical Error] Couldn't find constant CJBusinessBundle:PO:new, method
CJ\BusinessBundle\Controller\ProductController::createAction().

我的注释部分

/**
* Creates a new Product entity.
*
* @Route("/", name="product_create")
* @Method("POST")
* @Template(CJBusinessBundle:PO:new.html.twig)
*/

我不明白这会是什么问题

最佳答案

用引号括起您的模板定义。
否则,当查找注释时,它会在 PHP 常量中查找它,这就是您看到的错误,因为不存在具有该名称的常量。

/**
* Creates a new Product entity.
*
* @Route("/", name="product_create")
* @Method("POST")
* @Template("CJBusinessBundle:PO:new.html.twig")
*/

关于php - 什么是语义错误 Symfony2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15874241/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com