View: Add methods setHelperFunction and dropHelperFunction
This commit is contained in:
parent
e9681de388
commit
4774db16ef
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue