【发布时间】:2012-08-07 08:21:54
【问题描述】:
我像这样将 var argurmrnt 传递给控制器
return $this->redirect($this->generateUrl('user_profile', array('var' => $profile->getId())));
这是我的控制器
/**
* @Route("/profile", name="user_profile")
* @Template()
*/
public function ProfileAction($var)
{
$em = $this->getDoctrine()->getEntityManager();
但我不断收到错误
控制器“xxxx\Controller\UserController::ProfileAction()”需要 为“$var”参数提供一个值(因为没有 默认值或因为在此之后有一个非可选参数 一)。
【问题讨论】:
标签: php symfony controller