mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 23:34:08 +02:00
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…
x
Reference in New Issue
Block a user