我已经读到我需要设置一个路由来保留 URL 中的值。这是 zendframework 参考指南中显示的 application.ini 示例:
routes.example.route = articles/:articleName/:page
routes.example.defaults.controller = articles
routes.example.defaults.action = view
routes.example.defaults.page = 1
routes.example.reqs.articleName = \w+
routes.example.reqs.page = \d+
如何使用上面的配置实例化对象并在我的引导程序中使用它?例子:
$route = new Zend_Controller_Router_Route(
'product/:id',
array(
'module' => 'default',
'controller' => 'product',
'action' => 'detail',
),
);
$router->addRoute('product', $route);