mirror of
https://github.com/Icinga/icingaweb2.git
synced 2026-05-28 04:02:39 -04:00
View: Add methods setHelperFunction and dropHelperFunction
This commit is contained in:
parent
e9681de388
commit
4774db16ef
1 changed files with 27 additions and 0 deletions
|
|
@ -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 a new issue