Zend 分页器和路由
我读过,我需要设置一个路由来保留 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+
How can I instantiate the object with the config above and use it in my bootstrap? 例子:
$route = new Zend_Controller_Router_Route(
'product/:id',
array(
'module' => 'default',
'controller' => 'product',
'action' => 'detail',
),
);
$router->addRoute('product', $route);
I have read that I would need to setup a route to keep the values in the URL.
That's the application.ini example showed in the zendframework reference guide:
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+
How could I instantiate the object with the config above and use it in my bootstrap?
Example:
$route = new Zend_Controller_Router_Route(
'product/:id',
array(
'module' => 'default',
'controller' => 'product',
'action' => 'detail',
),
);
$router->addRoute('product', $route);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现,zend 控制器路由器路由器收到的第二个数组参数是可变需求。
I figured out, the second array param received by the zend controller router router are the variable requirements.