I have a trouble with zend_controller_Router_Route.
I have created a route:
$router = $this->frontController->getRouter();
$route = new Zend_Controller_Router_Route(
'catalog/:categoryIdent/:page',
array( 'action' => 'index',
'controller' => 'catalog',
'module' => 'storefront',
'categoryIdent' => '',
'page' => 1 ),
array( 'categoryIdent' => '[a-zA-Z-_0-9]+',
'page' => '\d+' ) ); $router开发者_运维技巧->addRoute('catalog_category', $route);
and this my view script:
<div class="sub-nav">
<h3>select <span>category</span></h3>
<ul>
<? foreach ($this->categories as $category): ?>
<li><a href="<?=$this->url(array('categoryIdent' => $category->ident), 'catalog_category', true );?>"><?=$category->name; ?></a></li>
<? endforeach; ?>
</ul>
when i move mouse over a category, its href is exact (example :http://localhost/projectzend/chapter5/public/catalog/hats). But when i click, it return a url - http://localhost/
Where could be the problem?
精彩评论