相关疑难解决方法(0)

使用Zend Framework中的Zend_Controller_Router_Route_Regex在参数中匹配多个URL

我正在使用Zend开发一个Rest Controller,我对url到Router的映射感到困惑.

基本上我读了Zend路由器,我无法计划我的网址,以满足上述路线.

这些是我应该映射到路由器的一些网址.

  1. HTTP://localhost/api/v1/tags.xml

  2. http://localhost/api/v1/tags.xml?abc = true (param:abc = true)

  3. http://localhost/api/v1/tags/123456.xml (param:123456.xml)

  4. http://localhost/api/v1/tags/123456/pings.xml (参数:123456,pings.xml)

  5. http://localhost/api/v1/tags/123456/pings.xml?a = 1&b = 2(参数:123456,pings.xml,a = 1,b = 2)

  6. http://localhost/api/v1/tags/123456/pings/count.xml(参数:123456,ping,count.xml)

我正在计划,对于网址模式1到3,"标签"应该是控制器,对于网址模式4到6,"ping"应该是控制器.

现在我不确定如何配置路由器,以便上述方案可行.请注意,我无法更改这些网址.我可以提供100分的良好答案.

php zend-framework zend-route

8
推荐指数
1
解决办法
3365
查看次数

标签 统计

php ×1

zend-framework ×1

zend-route ×1