public function plugin($plugin, $options = null)
    {
        $renderer = $this->getView();

        if (!method_exists($renderer, 'getHelperPluginManager')) {
            return true === $options ? false : new HelperProxy(false);
        }

        /* @var \Zend\View\HelperPluginManager $manager */
        $manager   = $renderer->getHelperPluginManager();
        $hasPlugin = $manager->has($plugin);

        if (true === $options) {
            return $hasPlugin;
        }

        if ($hasPlugin) {
            $pluginInstance = $manager->get($plugin, $options);
        } else {
            $pluginInstance = false;
        }

        return new HelperProxy($pluginInstance);
    }
public function plugin($plugin, $options = null)
    {
        $renderer = $this->getView();

        if (!method_exists($renderer, 'getHelperPluginManager')) {
            return true === $options ? false : new HelperProxy(false);
        }

        /* @var \Zend\View\HelperPluginManager $manager */
        $manager   = $renderer->getHelperPluginManager();
        $hasPlugin = $manager->has($plugin);

        if (true === $options) {
            return $hasPlugin;
        }

        if ($hasPlugin) {
            $pluginInstance = $manager->get($plugin, $options);
        } else {
            $pluginInstance = false;
        }

        return new HelperProxy($pluginInstance);
    }
public function plugin ( $ plugin , $ options = null ) { $ renderer = $ this -> getView ( ) ; if ( ! method_exists ( $ renderer , 'getHelperPluginManager' ) ) { return true === $ options ? false : new HelperProxy ( false ) ; } /* @var \Zend\View\HelperPluginManager $manager */ $ manager = $ renderer -> getHelperPluginManager ( ) ; $ hasPlugin = $ manager -> has ( $ plugin ) ; if ( true === $ options ) { return $ hasPlugin ; } if ( $ hasPlugin ) { $ pluginInstance = $ manager -> get ( $ plugin , $ options ) ; } else { $ pluginInstance = false ; } return new HelperProxy ( $ pluginInstance ) ; }
Loads a plugin from the plugin helper manager.

Returns false, if either the helper plugin manager cannot be
retrieved from the renderer or the requested plugin does not exist.

@param string $plugin
@param true|array  $options if true, only return if plugin exists or not.

@return bool|HelperProxy
Loads a plugin from the plugin helper manager .