Zend\Mvc\Controller\PluginManager::get PHP Method

get() public method

After the plugin is retrieved from the service locator, inject the controller in the plugin every time it is requested. This is required because a controller can use a plugin and another controller can be dispatched afterwards. If this second controller uses the same plugin as the first controller, the reference to the controller inside the plugin is lost.
public get ( string $name, array $options = null ) : Zend\Stdlib\DispatchableInterface
$name string
$options array
return Zend\Stdlib\DispatchableInterface
    public function get($name, array $options = null)
    {
        $plugin = parent::get($name, $options);
        $this->injectController($plugin);
        return $plugin;
    }

Usage Example

 /**
  * Retourne le plugin url.
  *
  * @var \Zend\Mvc\Controller\PluginManager
  */
 public function url()
 {
     if (!$this->_url) {
         $this->_url = $this->_pluginManager->get('url');
     }
     return $this->_url;
 }
All Usage Examples Of Zend\Mvc\Controller\PluginManager::get