[英]route parameter symfony
I defined this route 我定义了这条路线
teln_operator_edit_1:
pattern: /edit1/{id}/{step}
defaults: { _controller: TelnOperatorBundle:Operator:step1 }
and I get 我得到
/Symfony/web/app_dev.php/edit1/13/1 I want to get the step value how to do that? /Symfony/web/app_dev.php/edit1/13/1我想获取步骤值该怎么做?
You'll get URL parameter value into your action method as a parameter: 您将URL参数值作为参数输入到您的操作方法中:
public function step1Action($id, $step) {
// ...
}
Make sure method parameter names are equivalent to parameter names in your pattern. 确保方法参数名称与您的模式中的参数名称等效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.