public function init()
 {
     if (HelperAbstract::$_view === null) {
         $this->getBootstrap()->bootstrap('view');
         HelperAbstract::$_view = $this->getBootstrap()->view;
     }
 }
 public function getHeadTitle()
 {
     if ($this->_headTitle === null) {
         parent::init();
         $options = $this->getOptions();
         $this->_headTitle = $this->_getView()->headTitle($options['title'], $this->_type);
         $this->_headTitle->setSeparator($this->_separator);
         if ($this->_translate) {
             $this->_headTitle->enableTranslation();
         } else {
             $this->_headTitle->disableTranslation();
         }
     }
     return $this->_headTitle;
 }
 protected function _getView()
 {
     if (HelperAbstract::$_view === null) {
         if ($this->_getBootstrap()->hasResource('view')) {
             HelperAbstract::$_view = $this->_getBootstrap()->getResource('view');
         } else {
             if (\Zend_Registry::isRegistered('Zend_View')) {
                 HelperAbstract::$_view = \Zend_Registry::get('Zend_View');
             } else {
                 // There is not registered \Zend_Navigation_Containter; we are going
                 // to register one through the bootstrap
                 HelperAbstract::$_view = new \Zend_View();
                 \Zend_Registry::set('view', HelperAbstract::$_view);
             }
         }
     }
     return HelperAbstract::$_view;
 }
Ejemplo n.º 4
0
 /**
  * Magic overload: Proxy to other navigation helpers or the container
  *
  * Examples of usage from a view script or layout:
  * <code>
  * // proxy to Menu helper and render container:
  * echo $this->navigation()->menu();
  *
  * // proxy to Breadcrumbs helper and set indentation:
  * $this->navigation()->breadcrumbs()->setIndent(8);
  *
  * // proxy to container and find all pages with 'blog' route:
  * $blogPages = $this->navigation()->findAllByRoute('blog');
  * </code>
  *
  * @param  string $method             helper name or method name in
  *                                    container
  * @param  array  $arguments          [optional] arguments to pass
  * @return mixed                      returns what the proxied call returns
  * @throws \Zend\View\Exception        if proxying to a helper, and the
  *                                    helper is not an instance of the
  *                                    interface specified in
  *                                    {@link findHelper()}
  * @throws \Zend\Navigation\Exception  if method does not exist in container
  */
 public function __call($method, array $arguments = array())
 {
     // check if call should proxy to another helper
     if ($helper = $this->findHelper($method, false)) {
         return call_user_func_array(array($helper, $method), $arguments);
     }
     // default behaviour: proxy call to container
     return parent::__call($method, $arguments);
 }
Ejemplo n.º 5
0
 /**
  * Set debug option on or off
  *
  * Made public to match Xmf module helper. Since this class is used
  * when a module doesn't have its own helper (yet) this is useful.
  *
  * @param bool $debug
  */
 public function setDebug($debug)
 {
     parent::setDebug($debug);
 }