DASPRiD wrote:
> 
> It would be helpful when you could provide a dump of the generate
> 
> 

Yes, this extend was wrong copy/paste.

Here is the code:

        // action body
        $navigation = new Zend_Navigation(new
Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation/main.xml', 'main'));

       $a = $navigation->toArray();
       $config = new My_Config($a);
       Zend_Debug::dump($config, 'config');

       $writer = new Zend_Config_Writer_Xml();
       $writer->write(APPLICATION_PATH . '/configs/navigation/nav2.xml',
$config);

And here is the output:


config 

object(My_Config)[30]
  protected '_allowModifications' => boolean false
  protected '_index' => int 0
  protected '_count' => int 2
  protected '_data' => 
    array
      0 => 
        object(Zend_Config)[45]
          protected '_allowModifications' => boolean false
          protected '_index' => int 0
          protected '_count' => int 20
          protected '_data' => 
            array
              'label' => string 'Home page' (length=9)
              'id' => null
              'class' => null
              'title' => null
              'target' => null
              'rel' => 
                object(Zend_Config)[47]
                  protected '_allowModifications' => boolean false
                  protected '_index' => int 0
                  protected '_count' => int 0
                  protected '_data' => 
                    array
                      empty
                  protected '_skipNextIteration' => null
                  protected '_loadedSection' => null
                  protected '_extends' => 
                    array
                      empty
                  protected '_loadFileErrorStr' => null
              'rev' => 
                object(Zend_Config)[49]
                  protected '_allowModifications' => boolean false
                  protected '_index' => int 0
                  protected '_count' => int 0
                  protected '_data' => 
                    array
                      empty
                  protected '_skipNextIteration' => null
                  protected '_loadedSection' => null
                  protected '_extends' => 
                    array
                      empty
                  protected '_loadFileErrorStr' => null
              'order' => int -100
              'resource' => null
              'privilege' => null
              'active' => boolean false
              'visible' => boolean true
              'type' => string 'Zend_Navigation_Page_Mvc' (length=24)
              'pages' => 
                object(Zend_Config)[48]
                  protected '_allowModifications' => boolean false
                  protected '_index' => int 0
                  protected '_count' => int 0
                  protected '_data' => 
                    array
                      empty
                  protected '_skipNextIteration' => null
                  protected '_loadedSection' => null
                  protected '_extends' => 
                    array
                      empty
                  protected '_loadFileErrorStr' => null
              'action' => string 'index' (length=5)
              'controller' => string 'index' (length=5)
              'module' => string 'default' (length=7)
              'params' => 
                object(Zend_Config)[46]
                  protected '_allowModifications' => boolean false
                  protected '_index' => int 0
                  protected '_count' => int 0
                  protected '_data' => 
                    array
                      empty
                  protected '_skipNextIteration' => null
                  protected '_loadedSection' => null
                  protected '_extends' => 
                    array
                      empty
                  protected '_loadFileErrorStr' => null
              'route' => null
              'reset_params' => boolean true
          protected '_skipNextIteration' => null
          protected '_loadedSection' => null
          protected '_extends' => 
            array
              empty
          protected '_loadFileErrorStr' => null
      1 => 
        object(Zend_Config)[44]
          protected '_allowModifications' => boolean false
          protected '_index' => int 0
          protected '_count' => int 15
          protected '_data' => 
            array
              'label' => string 'Projects' (length=8)
              'id' => null
              'class' => null
              'title' => null
              'target' => null
              'rel' => 
                object(Zend_Config)[54]
                  protected '_allowModifications' => boolean false
                  protected '_index' => int 0
                  protected '_count' => int 0
                  protected '_data' => 
                    array
                      empty
                  protected '_skipNextIteration' => null
                  protected '_loadedSection' => null
                  protected '_extends' => 
                    array
                      empty
                  protected '_loadFileErrorStr' => null
              'rev' => 
                object(Zend_Config)[56]
                  protected '_allowModifications' => boolean false
                  protected '_index' => int 0
                  protected '_count' => int 0
                  protected '_data' => 
                    array
                      empty
                  protected '_skipNextIteration' => null
                  protected '_loadedSection' => null
                  protected '_extends' => 
                    array
                      empty
                  protected '_loadFileErrorStr' => null
              'order' => null
              'resource' => null
              'privilege' => null
              'active' => boolean false
              'visible' => boolean true
              'type' => string 'Zend_Navigation_Page_Uri' (length=24)
              'pages' => 
                object(Zend_Config)[55]
                  protected '_allowModifications' => boolean false
                  protected '_index' => int 0
                  protected '_count' => int 3
                  protected '_data' => 
                    array
                      0 => 
                        object(Zend_Config)[57]
                          protected '_allowModifications' => boolean false
                          protected '_index' => int 0
                          protected '_count' => int 20
                          protected '_data' => 
                            array
                              'label' => string 'List projects' (length=13)
                              'id' => null
                              'class' => null
                              'title' => null
                              'target' => null
                              'rel' => 
                                object(Zend_Config)[58]
                                  protected '_allowModifications' => boolean
false
                                  protected '_index' => int 0
                                  protected '_count' => int 0
                                  protected '_data' => 
                                    array
                                      ...
                                  protected '_skipNextIteration' => null
                                  protected '_loadedSection' => null
                                  protected '_extends' => 
                                    array
                                      ...
                                  protected '_loadFileErrorStr' => null
                              'rev' => 
                                object(Zend_Config)[59]
                                  protected '_allowModifications' => boolean
false
                                  protected '_index' => int 0
                                  protected '_count' => int 0
                                  protected '_data' => 
                                    array
                                      ...
                                  protected '_skipNextIteration' => null
                                  protected '_loadedSection' => null
                                  protected '_extends' => 
                                    array
                                      ...
                                  protected '_loadFileErrorStr' => null
                              'order' => null
                              'resource' => null
                              'privilege' => null
                              'active' => boolean false
                              'visible' => boolean true
                              'type' => string 'Zend_Navigation_Page_Mvc'
(length=24)
                              'pages' => 
                                object(Zend_Config)[60]
                                  protected '_allowModifications' => boolean
false
                                  protected '_index' => int 0
                                  protected '_count' => int 0
                                  protected '_data' => 
                                    array
                                      ...
                                  protected '_skipNextIteration' => null
                                  protected '_loadedSection' => null
                                  protected '_extends' => 
                                    array
                                      ...
                                  protected '_loadFileErrorStr' => null
                              'action' => string 'list' (length=4)
                              'controller' => string 'projects' (length=8)
                              'module' => string 'default' (length=7)
                              'params' => 
                                object(Zend_Config)[61]
                                  protected '_allowModifications' => boolean
false
                                  protected '_index' => int 0
                                  protected '_count' => int 0
                                  protected '_data' => 
                                    array
                                      ...
                                  protected '_skipNextIteration' => null
                                  protected '_loadedSection' => null
                                  protected '_extends' => 
                                    array
                                      ...
                                  protected '_loadFileErrorStr' => null
                              'route' => null
                              'reset_params' => boolean true
                          protected '_skipNextIteration' => null
                          protected '_loadedSection' => null
                          protected '_extends' => 
                            array
                              empty
                          protected '_loadFileErrorStr' => null
                      1 => 
                        object(Zend_Config)[62]
                          protected '_allowModifications' => boolean false
                          protected '_index' => int 0
                          protected '_count' => int 20
                          protected '_data' => 
                            array
                              'label' => string 'New project' (length=11)
                              'id' => null
                              'class' => null
                              'title' => null
                              'target' => null
                              'rel' => 
                                object(Zend_Config)[63]
                                  protected '_allowModifications' => boolean
false
                                  protected '_index' => int 0
                                  protected '_count' => int 0
                                  protected '_data' => 
                                    array
                                      ...
                                  protected '_skipNextIteration' => null
                                  protected '_loadedSection' => null
                                  protected '_extends' => 
                                    array
                                      ...
                                  protected '_loadFileErrorStr' => null
                              'rev' => 
                                object(Zend_Config)[64]
                                  protected '_allowModifications' => boolean
false
                                  protected '_index' => int 0
                                  protected '_count' => int 0
                                  protected '_data' => 
                                    array
                                      ...
                                  protected '_skipNextIteration' => null
                                  protected '_loadedSection' => null
                                  protected '_extends' => 
                                    array
                                      ...
                                  protected '_loadFileErrorStr' => null
                              'order' => null
                              'resource' => null
                              'privilege' => null
                              'active' => boolean false
                              'visible' => boolean true
                              'type' => string 'Zend_Navigation_Page_Mvc'
(length=24)
                              'pages' => 
                                object(Zend_Config)[65]
                                  protected '_allowModifications' => boolean
false
                                  protected '_index' => int 0
                                  protected '_count' => int 0
                                  protected '_data' => 
                                    array
                                      ...
                                  protected '_skipNextIteration' => null
                                  protected '_loadedSection' => null
                                  protected '_extends' => 
                                    array
                                      ...
                                  protected '_loadFileErrorStr' => null
                              'action' => string 'new' (length=3)
                              'controller' => string 'projects' (length=8)
                              'module' => string 'default' (length=7)
                              'params' => 
                                object(Zend_Config)[66]
                                  protected '_allowModifications' => boolean
false
                                  protected '_index' => int 0
                                  protected '_count' => int 0
                                  protected '_data' => 
                                    array
                                      ...
                                  protected '_skipNextIteration' => null
                                  protected '_loadedSection' => null
                                  protected '_extends' => 
                                    array
                                      ...
                                  protected '_loadFileErrorStr' => null
                              'route' => null
                              'reset_params' => boolean true
                          protected '_skipNextIteration' => null
                          protected '_loadedSection' => null
                          protected '_extends' => 
                            array
                              empty
                          protected '_loadFileErrorStr' => null
                      2 => 
                        object(Zend_Config)[67]
                          protected '_allowModifications' => boolean false
                          protected '_index' => int 0
                          protected '_count' => int 20
                          protected '_data' => 
                            array
                              'label' => string 'Process next URL'
(length=16)
                              'id' => null
                              'class' => null
                              'title' => null
                              'target' => null
                              'rel' => 
                                object(Zend_Config)[68]
                                  protected '_allowModifications' => boolean
false
                                  protected '_index' => int 0
                                  protected '_count' => int 0
                                  protected '_data' => 
                                    array
                                      ...
                                  protected '_skipNextIteration' => null
                                  protected '_loadedSection' => null
                                  protected '_extends' => 
                                    array
                                      ...
                                  protected '_loadFileErrorStr' => null
                              'rev' => 
                                object(Zend_Config)[69]
                                  protected '_allowModifications' => boolean
false
                                  protected '_index' => int 0
                                  protected '_count' => int 0
                                  protected '_data' => 
                                    array
                                      ...
                                  protected '_skipNextIteration' => null
                                  protected '_loadedSection' => null
                                  protected '_extends' => 
                                    array
                                      ...
                                  protected '_loadFileErrorStr' => null
                              'order' => null
                              'resource' => null
                              'privilege' => null
                              'active' => boolean false
                              'visible' => boolean true
                              'type' => string 'Zend_Navigation_Page_Mvc'
(length=24)
                              'pages' => 
                                object(Zend_Config)[70]
                                  protected '_allowModifications' => boolean
false
                                  protected '_index' => int 0
                                  protected '_count' => int 0
                                  protected '_data' => 
                                    array
                                      ...
                                  protected '_skipNextIteration' => null
                                  protected '_loadedSection' => null
                                  protected '_extends' => 
                                    array
                                      ...
                                  protected '_loadFileErrorStr' => null
                              'action' => string 'process' (length=7)
                              'controller' => string 'projects' (length=8)
                              'module' => string 'default' (length=7)
                              'params' => 
                                object(Zend_Config)[71]
                                  protected '_allowModifications' => boolean
false
                                  protected '_index' => int 0
                                  protected '_count' => int 0
                                  protected '_data' => 
                                    array
                                      ...
                                  protected '_skipNextIteration' => null
                                  protected '_loadedSection' => null
                                  protected '_extends' => 
                                    array
                                      ...
                                  protected '_loadFileErrorStr' => null
                              'route' => null
                              'reset_params' => boolean true
                          protected '_skipNextIteration' => null
                          protected '_loadedSection' => null
                          protected '_extends' => 
                            array
                              empty
                          protected '_loadFileErrorStr' => null
                  protected '_skipNextIteration' => null
                  protected '_loadedSection' => null
                  protected '_extends' => 
                    array
                      empty
                  protected '_loadFileErrorStr' => null
              'uri' => string '' (length=0)
          protected '_skipNextIteration' => null
          protected '_loadedSection' => null
          protected '_extends' => 
            array
              empty
          protected '_loadFileErrorStr' => null
  protected '_skipNextIteration' => null
  protected '_loadedSection' => null
  protected '_extends' => 
    array
      empty
  protected '_loadFileErrorStr' => null


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
-- 
View this message in context: 
http://www.nabble.com/Zend_Navigation-save-to-XML-tp24604976p24624898.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to