Php 使用symfony3预期值时出现批注错误,获取;邮政「;
我有一个Symfony应用程序,我试图向action函数提交一个简单的表单,显然我的注释是错误的,但我不知道如何修复它们。下面是全部错误 [语法错误]预期值,在方法中的位置58处获得“POST” 中的AppBundle\Controller\ProjectController::showAction() C:\xampp\htdocs\TaskManager\src\AppBundle/Controller/(哪个是 进口自 “C:\xampp\htdocs\TaskManager\app/config\routing.yml”) 这是我试图在Php 使用symfony3预期值时出现批注错误,获取;邮政「;,php,forms,symfony,Php,Forms,Symfony,我有一个Symfony应用程序,我试图向action函数提交一个简单的表单,显然我的注释是错误的,但我不知道如何修复它们。下面是全部错误 [语法错误]预期值,在方法中的位置58处获得“POST” 中的AppBundle\Controller\ProjectController::showAction() C:\xampp\htdocs\TaskManager\src\AppBundle/Controller/(哪个是 进口自 “C:\xampp\htdocs\TaskManager\app/co
show.html.twig
<form method="post">
<input type="submit" name="approve" value="Approve">
<input type="submit" name="reject" value="Reject">
</form>
在我更改这些值之后,我打算刷新它们,这样当项目再次显示时,它将被批准或拒绝。这里的关键是不应该有字段。当我想展示一个项目时,我已经拥有了冲洗它所需的一切。以下是我对showAction()的注释-
这里是我在editAction()
中的注释,仅供比较,效果不错
/**
* Displays a form to edit an existing project entity.
*
* @Route("/{id}/edit", name="project_edit")
* @Method({"GET", "POST"})
*/
我需要什么才能在我的
showAction()
中提交这个简单表单?看起来你在@Method
注释中缺少大括号({}
)
尝试更改此选项:
* @Method("GET","POST")
为此:
* @Method({"GET","POST"})
看起来您在
@Method
注释中缺少大括号({}
)
尝试更改此选项:
* @Method("GET","POST")
为此:
* @Method({"GET","POST"})