我有一些问题Zend助手。据我所知,我正在按照手册做每件事。我的路线是:
$route = new Zend_Controller_Router_Route_Static('client-portal/address-book/edit/:address_id',array('controller' => 'client-portal', 'action' => 'address-edit'));
$router->addRoute('client-portal-settings-address-edit', $route);我用硬编码的值调用它,这样我就不会传递这样的空值:
$this->url(array('address_id' => 3), 'client-portal-settings-address-edit', true);但是调用的输出是:
/client-portal/address-book/edit/:addressId所以没有参数替代。有人能照亮这一点并帮助它为什么要这样做吗?
发布于 2013-07-29 15:09:21
您使用的是“静态”路由类型,它用于精确匹配的URL(即不包含变量的URL)。因为您的URL确实包含变量,所以您可能需要Zend_Controller_Router_Route:
$route = new Zend_Controller_Router_Route(
'client-portal/address-book/edit/:address_id',
array(
'controller' => 'client-portal',
'action' => 'address-edit'
)
);
$router->addRoute('client-portal-settings-address-edit', $route);https://stackoverflow.com/questions/17927066
复制相似问题