2009年11月20日星期五

[fw-mvc] Zend_Navigation & custom routes = several problems

Hi list,

to create my navigation I use the following bootstrap-code:

$config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
$nav = new Zend_Application_Resource_Navigation(array('pages' => $config));

Contents of navigation.xml:

<?xml version="1.0" encoding="UTF-8"?>
<configdata>
<nav>
<index>
<label>nav_index</label>
<controller>index</controller>
<action>index</action>
</index>
<release>
<label>nav_release</label>
<controller>title</controller>
<action>list</action>
<route>titlelist</route>
<params>
<char>0-9</char>
<page>1</page>
</params>
</release>
<names>
<label>nav_names</label>
<controller>names</controller>
<action>list</action>
<route>nameslist</route>
<params>
<char>A</char>
<page>1</page>
</params>
</names>
<label>
<label>nav_label</label>
<controller>sites</controller>
<action>list</action>
<route>labellist</route>
<params>
<char>0-9</char>
<page>1</page>
</params>
</label>
<search>
<label>nav_search</label>
<controller>search</controller>
</search>
<help>
<label>nav_help</label>
<controller>help</controller>
</help>
<forum>
<label>nav_forum</label>
<uri>http://www.soundtrack-board.de</uri>
</forum>
</nav>
</configdata>

This works and the navigation gets created, BUT when I hover the links which uses no named route, the links isn't just the expected controller/action-couple but the actual route used for the page I'm on, e.g.

/public/names/0-9-p1.html but it should show /public/search

My custom routes are utilizing Zend_Controller_Router_Route_Regex.

The other problem is: There is no active link and so I can't use some of the helper methods to enhance my navigation with a sub-navigation.

What do I wrong?

- Marcus

没有评论: