【发布时间】:2019-01-10 08:18:40
【问题描述】:
我正在尝试使用 FOSRestBundle 和 Symfony 为两个不同的功能提供相同的路由。这是我所拥有的:
/**
* @Rest\Get("/users")
* @QueryParam(name="login")
*/
public function getLoginAvailability(ParamFetcher $paramFetcher)
{
return $this->_checkLoginAvailability($paramFetcher->get('login'));
}
/**
* @Rest\Get("/users")
*/
public function otherFunc()
{
return "other";
}
问题是:当我通过 HTTP GET 请求(给它一个登录参数)调用第一个函数时,它正在执行第二个函数,而忽略了第一个函数。有什么建议吗?
【问题讨论】:
标签: php rest symfony fosrestbundle