Navigation.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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-2015 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. * @version $Id$
  20. */
  21. /**
  22. * @see Zend_Navigation_Container
  23. */
  24. require_once 'Zend/Navigation/Container.php';
  25. /**
  26. * A simple container class for {@link Zend_Navigation_Page} pages
  27. *
  28. * @category Zend
  29. * @package Zend_Navigation
  30. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  31. * @license http://framework.zend.com/license/new-bsd New BSD License
  32. */
  33. class Zend_Navigation extends Zend_Navigation_Container
  34. {
  35. /**
  36. * Creates a new navigation container
  37. *
  38. * @param array|Zend_Config $pages [optional] pages to add
  39. * @throws Zend_Navigation_Exception if $pages is invalid
  40. */
  41. public function __construct($pages = null)
  42. {
  43. if (is_array($pages) || $pages instanceof Zend_Config) {
  44. $this->addPages($pages);
  45. } elseif (null !== $pages) {
  46. require_once 'Zend/Navigation/Exception.php';
  47. throw new Zend_Navigation_Exception(
  48. 'Invalid argument: $pages must be an array, an ' .
  49. 'instance of Zend_Config, or null');
  50. }
  51. }
  52. }