douxiawei9318
2015-10-14 10:50
浏览 29
已采纳

Symfony2 routing.yml的评论 - 怎么做?

This is the routing in my Symfony2 App (part of routing.yml):

app_my_responses_response:
    path: /author/response/{responseId}/comments/{page}
    defaults: { _controller: AppBundle:Response:view, page: 1 }
    methods: [GET]
    requirements:
        responseId: \d+

Objective of this route – execute on next cases (

  1. /author/response/8293085 { page:1 }
  2. /author/response/8293085/ { page:1 }
  3. /author/response/8293085/comments/ { page:1 }
  4. /author/response/8293085/comments/1/ { page:1 }
  5. /author/response/8293085/comments/2/ { page:2 }

I have problems with urls numbered 1 and 3...and I don't know what to do...

图片转代码服务由CSDN问答提供 功能建议

这是我的Symfony2应用程序中的路由(routing.yml的一部分):</ p>

  app_my_responses_response:
 path:/ author / response / {responseId} / comments / {page} 
 defaults:{_ control:AppBundle:Response:view,page:1} 
方法:[GET]  
要求:
 responseId:\ d + 
 </ code> </ pre> 
 
 

此路线的目标 - 在下一个案例中执行(</ p>

  1. / author / response / 8293085 {page:1} </ li>
  2. / author / response / 8293085 / {page:1} </ li>
  3. / author / response / 8293085 / comments / {page:1} </ li>
  4. / author / response / 8293085 / comments / 1 / {page:1} </ li>
  5. / author / response / 8293085 / comments / 2 / {page:2} </ li> </ ol>

    我遇到了编号为1和3的网址问题...我不知道该怎么做...... < / p> </ div>

1条回答 默认 最新

相关推荐 更多相似问题