View: Add methods setHelperFunction and dropHelperFunction

This commit is contained in:
Johannes Meyer 2016-07-11 09:07:01 +02:00
parent e9681de388
commit 4774db16ef
1 changed files with 27 additions and 0 deletions

View File

@ -119,6 +119,33 @@ class View extends Zend_View_Abstract
return $this;
}
/**
* Set or overwrite a helper function
*
* @param string $name
* @param Closure $function
*
* @return $this
*/
public function setHelperFunction($name, Closure $function)
{
$this->helperFunctions[$name] = $function;
return $this;
}
/**
* Drop a helper function
*
* @param string $name
*
* @return $this
*/
public function dropHelperFunction($name)
{
unset($this->helperFunctions[$name]);
return $this;
}
/**
* Call a helper function
*