Adding pages to a container can be done with the methods
addPage(), addPages(), or
setPages(). See examples below for explanation.
Example 617. Adding pages to a container
<?php
// create container
$container = new Zend_Navigation();
// add page by giving a page instance
$container->addPage(Zend_Navigation_Page::factory(array(
'uri' => 'http://www.example.com/'
)))
// add page by giving an array
$container->addPage(array(
'uri' => 'http://www.example.com/'
)))
// add page by giving a config object
$container->addPage(new Zend_Config(array(
'uri' => 'http://www.example.com/'
)))
$pages = array(
array(
'label' => 'Save'
'action' => 'save',
),
array(
'label' => 'Delete',
'action' => 'delete'
)
);
// add two pages
$container->addPages($pages);
// remove existing pages and add the given pages
$container->setPages($pages);




