web/lib/Zend/Navigation.php
changeset 64 162c1de6545a
parent 19 1c2f13fd785c
child 68 ecaf28ffe26e
equal deleted inserted replaced
63:5b37998e522e 64:162c1de6545a
       
     1 <?php
       
     2 /**
       
     3  * Zend Framework
       
     4  *
       
     5  * LICENSE
       
     6  *
       
     7  * This source file is subject to the new BSD license that is bundled
       
     8  * with this package in the file LICENSE.txt.
       
     9  * It is also available through the world-wide-web at this URL:
       
    10  * http://framework.zend.com/license/new-bsd
       
    11  * If you did not receive a copy of the license and are unable to
       
    12  * obtain it through the world-wide-web, please send an email
       
    13  * to license@zend.com so we can send you a copy immediately.
       
    14  *
       
    15  * @category  Zend
       
    16  * @package   Zend_Navigation
       
    17  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    18  * @license   http://framework.zend.com/license/new-bsd     New BSD License
       
    19  * @version    $Id: Navigation.php 20096 2010-01-06 02:05:09Z bkarwin $
       
    20  */
       
    21 
       
    22 /**
       
    23  * @see Zend_Navigation_Container
       
    24  */
       
    25 require_once 'Zend/Navigation/Container.php';
       
    26 
       
    27 /**
       
    28  * A simple container class for {@link Zend_Navigation_Page} pages
       
    29  *
       
    30  * @category  Zend
       
    31  * @package   Zend_Navigation
       
    32  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    33  * @license   http://framework.zend.com/license/new-bsd     New BSD License
       
    34  */
       
    35 class Zend_Navigation extends Zend_Navigation_Container
       
    36 {
       
    37     /**
       
    38      * Creates a new navigation container
       
    39      *
       
    40      * @param array|Zend_Config $pages    [optional] pages to add
       
    41      * @throws Zend_Navigation_Exception  if $pages is invalid
       
    42      */
       
    43     public function __construct($pages = null)
       
    44     {
       
    45         if (is_array($pages) || $pages instanceof Zend_Config) {
       
    46             $this->addPages($pages);
       
    47         } elseif (null !== $pages) {
       
    48             require_once 'Zend/Navigation/Exception.php';
       
    49             throw new Zend_Navigation_Exception(
       
    50                     'Invalid argument: $pages must be an array, an ' .
       
    51                     'instance of Zend_Config, or null');
       
    52         }
       
    53     }
       
    54 }