Mezoni,

Thanks for the help.

I tried moving the ini code into the 'application.ini' file and that worked
fine.  I also found Zend_Navigation is still accessible via the view helper
when doing it this way...

// in layout.phtml
$container = $this->navigation()->getContainer();

As well as accessing it from Zend_Registry.

Also, thank you because your response helped me trouble shoot why I wasn't
getting an INI file working using the code:

$config = new Zend_Config_Ini(APPLICATION_PATH .
'/configs/navigation_uri.ini');
$navigation = new Zend_Navigation($config);
$view->navigation($navigation); 

I was getting an "Invalid argument: Unable to determine class to
instantiate" error in the Zend_Navigation_Page class.  Somehow the Config
variables where not lining up compared to my XML file and my INI file.

What I did to solve it, once I followed your suggestion and tried it and it
worked, was I did a simple echo data dump:

echo '<pre>';
print_r($config);
echo '</pre>';

and compared how the config files were being created and at what starting
node.  The answer was to pass the config file at this point:

$config = new Zend_Config_Ini(APPLICATION_PATH .
'/configs/navigation_uri.ini');
$navigation = new Zend_Navigation($config->resources->navigation->pages);
$view->navigation($navigation); 

Or if one's creating a separate INI file, just create the INI file like so
(and cut out a lot of unnecessary writing):

home.label = Home 
home.uri = / 
products.label = Products 
products.uri = /products 
products.pages.widgets.label = Widgets 
products.pages.widgets.uri = /products/widgets 
products.pages.sprockets.label = Sprockets 
products.pages.sprockets.uri = /products/prockets 
aboutus.label = About Us 
aboutus.uri = /company/aboutus

So, I hope this helps others troubleshoot or answer the same questions they
might have!

Cheers!
Fozzy
-- 
View this message in context: 
http://n4.nabble.com/Zend-Navigation-in-application-ini-in-ralphschindler-s-webninar-tp661093p961368.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to