+ -
当前位置:首页 → 问答吧 → zend framework Zend_Controller_Router_Route

zend framework Zend_Controller_Router_Route

时间:2011-11-17

来源:互联网

路由规则怎么配置在哪里配置,我想重新配置URL
看了下一些文章,模模糊糊,不知道整个过程
是怎么样?谁可以说说,具体实现过程;例如下面的
PHP code

//新url的正则路由协议
$route = new Zend_Controller_Router_Route_Regex(
  'product/([a-zA-Z-_0-9]+)/(\d+)-([a-zA-Z-_0-9]+).html',
  array(
    'controller' => 'products',
    'action' => 'view'
  ),
  array(
    1 => 'categoryIdent',
    2 => 'productID',
    3 => 'productIdent'
  ),
  'product/%s/%d-%s.html'
);


老的URL格式:
http://storefront/products.php/category/{categoryID}/product/{productID}
新的URL的格式:
http://storefront/product/{categoryName}/{productID}-{productIdent}.html
代码能够理解,就是不懂怎么弄到自己项目中去..

作者: Xy_SuperMario   发布时间: 2011-11-17

新手求教啊,这样一个路由规则怎么添加啊~~~~

作者: Xy_SuperMario   发布时间: 2011-11-18