【发布时间】:2010-03-07 20:21:10
【问题描述】:
这是我在引导文件中的路由定义:
$router = $this->frontController->getRouter();
$route = new Zend_Controller_Router_Route_Static(
'tipovanie',
array('module' => 'default',
'controller' => 'index',
'action' => 'contest')
);
$router->addRoute('contest', $route);
现在,当我转到 /tipovanie 时,我会正确显示与 /index/contest 相同的内容。
但是,我正在使用 url 视图助手在我的布局中构造一些链接,如下所示:
<a href="<?php
echo $this->url(array('module' => 'default',
'controller' => 'view',
'action' => 'user',
'id' => $this->escape($u->id)),
null,
true);
?>"><?php echo $this->escape($u->username); ?></a>
这些链接指向:
/tipovanie
查看 /tipovanie 页面时。在其他没有静态重写路由的页面上,url 视图助手工作正常,打印的链接是正确的(例如 /view/user/id/5)。
【问题讨论】:
标签: php zend-framework