How to save Zend_Navigation to XML?

I tried like this:

$navigation = new Zend_Navigation(new Zend_Config_Xml(APPLICATION_PATH .
'/configs/navigation/main.xml', 'main'));
        
$config = new Zend_Config($navigation->toArray());
$config->setExtend('main');
        
$writer = new Zend_Config_Writer_Xml();
$writer->write(APPLICATION_PATH . '/configs/navigation/nav2.xml', $config);


I get: 
Catchable fatal error: Object of class Zend_Config could not be converted to
string in C:\Users\user\www\library\Zend\Config\Writer\Xml.php on line 182

Here is an similar issue:
http://framework.zend.com/issues/browse/ZF-5643?focusedCommentId=31247#action_31247

My main.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <main>
        <home>
            <label>Home page</label>
            <module>default</module>
            <controller>index</controller>
            <action>index</action>
            <order>-100</order>
        </home>

        <projects>
            <label>Projects</label>
            <uri></uri>
            <pages>
                <list>
                    <label>List projects</label>
                    <module>default</module>
                    <controller>projects</controller>
                    <action>list</action>
                </list>
                <new>
                    <label>New project</label>
                    <module>default</module>
                    <controller>projects</controller>
                    <action>new</action>
                </new>
                <process>
                    <label>Process next URL</label>
                    <module>default</module>
                    <controller>projects</controller>
                    <action>process</action>
                </process>
            </pages>

        </projects>

    </main>
</config>

-- 
regards
takeshin


-- 
View this message in context: 
http://www.nabble.com/Zend_Navigation-save-to-XML-tp24604976p24604976.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to