I'll to show what I mean.
routemap.php which is included in my bootstrap file:
Code: Select all
<?php
/*
swiftmailer.org route map file.
Adds routes for the front controller.
*/
$router = Zend_Controller_Front::getInstance()->getRouter();
$router->addRoute('index', new Zend_Controller_Router_Route(
'/',
array('controller'=>'index', 'action'=>'index')
));
$router->addRoute('docs', new Zend_Controller_Router_Route(
'/docs',
array('controller'=>'documentation', 'action'=>'index')
));
$router->addRoute('docs-file', new Zend_Controller_Router_Route(
'/docs/:topic',
array('controller'=>'documentation', 'action'=>'load-file')
));
unset($router);
Code: Select all
<div id="navigation">
<ul>
<li><a href="<?php echo $this->url(array('controller'=>'index', 'action'=>'index'), 'index'); ?>">home</a></li>
<li><a href="<?php echo $this->url(array('controller'=>'download', 'action'=>'index')); ?>">download</a></li>
<li><a href="<?php echo $this->url(array('controller'=>'documentation', 'action'=>'load-file', 'topic'=>'start'), 'docs-file'); ?>">documentation</a></li>
<li><a href="#">bugs</a></li>
<li><a href="#">contact</a></li>
<li class="tab corners top right left"><a href="#">download 4.0.0</a></li>
</ul>
</div>If I'm on the home page, then my current URL is / and therefore ZF is trying to link my "downloads" URL to /.
I've had this working in another project so I'm confused what I've done wrong here
Notice in my navigation, the URLs for "documentation" and "home" explicitly have the route name parameter in them? That's because if I take it out ZF tries to just generate a URL that is the same as the current URL.
Any clues?