예제 #1
0
    /**
     * Returns the helper matching $proxy
     *
     * The helper must implement the interface
     * {@link Zend_View_Helper_Navigation_Helper}.
     *
     * @param string $proxy                        helper name
     * @param bool   $strict                       [optional] whether
     *                                             exceptions should be
     *                                             thrown if something goes
     *                                             wrong. Default is true.
     * @return Zend_View_Helper_Navigation_Helper  helper instance
     * @throws Zend_Loader_PluginLoader_Exception  if $strict is true and
     *                                             helper cannot be found
     * @throws Zend_View_Exception                 if $strict is true and
     *                                             helper does not implement
     *                                             the specified interface
     */
    public function findHelper($proxy, $strict = true)
    {
		
        if (isset($this->_helpers[$proxy])) {
            return $this->_helpers[$proxy];
        }

		if (!$this->view->getPluginLoader('helper')->getPaths(parent::NS)) {
            $this->view->addHelperPath(
                    str_replace('_', '/', parent::NS),
                    parent::NS);
        }


		if (!$this->view->getPluginLoader('helper')->getPaths(self::NS)) {
            $this->view->addHelperPath(
                    str_replace('_', '/', self::NS),
                    self::NS);
        }

		return parent::findHelper($proxy, $strict);
    }
 /**
  * @group ZF-10458
  */
 public function testFindCustomHelper()
 {
     $this->_helper->view->addHelperPath($this->_files . '/helpers', 'My_View_Helper_Navigation');
     $this->assertTrue($this->_helper->findHelper('menu') instanceof My_View_Helper_Navigation_Menu);
 }