duanqianpu6499 2016-01-11 03:41
浏览 111
已采纳

@param关键字在symfony路由中做了什么

In annotations for a route what does @param mean?

I can not find any documentation on symfony website regarding this keyword and very confused as to what it's for and does.

I'm asking because I'm trying to figure out how to access parameters in my .yml files for use in the routes but I'd like to still use annotations instead of the YML method of routing.

Showing a code example is probably not the best for this but here is where @param shows up

/**
 * 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
 */

I took that from here (Symfony2 route in annotations with optional parameters)

Any help is appreciated, thanks!

  • 写回答

1条回答 默认 最新

  • dongliao4353 2016-01-11 03:46
    关注

    @param and @return are phpDocumentor annotations, and do not actually affect routing.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择
  • ¥15 这款软件是什么?需要能满足我的需求
  • ¥15 SpringSecurityOauth2登陆前后request不一致