@param 关键字在 symfony 路由中做什么
What does the @param keyword do in symfony routes
在路由注释中,@param 是什么意思?
我在 symfony 网站上找不到关于此关键字的任何文档,并且对它的用途和作用感到非常困惑。
我问是因为我想弄清楚如何访问我的 .yml 文件中的参数以用于路由,但我仍然想使用注释而不是 YML 路由方法。
显示代码示例可能不是最好的,但这里是 @param 出现的地方
/**
* League action
*
* @Route("/association/{assoc}/{league}", name="league", requirements={"league" = "\d+"}, defaults={"game" = null})
* @Route("/association/{assoc}/{league}/{game}")
* @Template()
*
* @param $assoc
* @param $league
* @param $game
* @return array
*/
我从这里拿来的 (Symfony2 route in annotations with optional parameters)
感谢任何帮助,谢谢!
@param
和@return
是phpDocumentor annotations,实际上不影响路由。
在路由注释中,@param 是什么意思?
我在 symfony 网站上找不到关于此关键字的任何文档,并且对它的用途和作用感到非常困惑。
我问是因为我想弄清楚如何访问我的 .yml 文件中的参数以用于路由,但我仍然想使用注释而不是 YML 路由方法。
显示代码示例可能不是最好的,但这里是 @param 出现的地方
/**
* League action
*
* @Route("/association/{assoc}/{league}", name="league", requirements={"league" = "\d+"}, defaults={"game" = null})
* @Route("/association/{assoc}/{league}/{game}")
* @Template()
*
* @param $assoc
* @param $league
* @param $game
* @return array
*/
我从这里拿来的 (Symfony2 route in annotations with optional parameters)
感谢任何帮助,谢谢!
@param
和@return
是phpDocumentor annotations,实际上不影响路由。