diff --git a/library/Zend/View/Renderer/PhpRenderer.php b/library/Zend/View/Renderer/PhpRenderer.php index a527a1d0c6f..8268a6ff8a1 100644 --- a/library/Zend/View/Renderer/PhpRenderer.php +++ b/library/Zend/View/Renderer/PhpRenderer.php @@ -93,6 +93,11 @@ class PhpRenderer implements Renderer, TreeRendererInterface */ private $__varsCache = array(); + /** + * @var array Cache for the plugin call + */ + private $__pluginCache = array(); + /** * Constructor. * @@ -350,11 +355,13 @@ public function plugin($name, array $options = null) */ public function __call($method, $argv) { - $helper = $this->plugin($method); - if (is_callable($helper)) { - return call_user_func_array($helper, $argv); + if (!isset($this->__pluginCache[$method])) { + $this->__pluginCache[$method] = $this->plugin($method); + } + if (is_callable($this->__pluginCache[$method])) { + return call_user_func_array($this->__pluginCache[$method], $argv); } - return $helper; + return $this->__pluginCache[$method]; } /**