Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我定义了这条路线
teln_operator_edit_1: pattern: /edit1/{id}/{step} defaults: { _controller: TelnOperatorBundle:Operator:step1 }
我得到
/Symfony/web/app_dev.php/edit1/13/1 我想获取步长值怎么做?
您将 URL 参数值作为参数获取到您的操作方法中:
public function step1Action($id, $step) { // ... }
确保方法参数名称与您的模式中的参数名称相同。