[icinga-checkins] icinga.org: icingaweb2/master: View: Add methods setHelperFunction and dropHelperFunction

git at icinga.org git at icinga.org
Mon Jul 11 09:09:08 CEST 2016


Module: icingaweb2
Branch: master
Commit: 4774db16ef375a75b3c338a2ecc43a16ffddb900
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=4774db16ef375a75b3c338a2ecc43a16ffddb900

Author: Johannes Meyer <johannes.meyer at netways.de>
Date:   Mon Jul 11 09:07:01 2016 +0200

View: Add methods setHelperFunction and dropHelperFunction

---

 library/Icinga/Web/View.php |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/library/Icinga/Web/View.php b/library/Icinga/Web/View.php
index 8a86d4d..ce1ea01 100644
--- a/library/Icinga/Web/View.php
+++ b/library/Icinga/Web/View.php
@@ -120,6 +120,33 @@ class View extends Zend_View_Abstract
     }
 
     /**
+     * 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
      *
      * @param  string  $name The desired function name



More information about the icinga-checkins mailing list