diff options
author | Joe7 <jozsef.rnagy@site.hu> | 2011-01-02 18:59:23 +0100 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2011-01-03 11:38:13 -0800 |
commit | cfaa62370ecbdb3badf4ab68bbefa7cfedaea154 (patch) | |
tree | 7cc8dbb5c6c21ca6e693be391c18cc3116bb64b3 /modules/gallery/libraries/MY_View.php | |
parent | e6a5f39b9113fa9cfc526b873947e365793d4e3e (diff) |
Reimplemented Kohana 2.3's View::set_global() with array support.
Allows for cleaner code and fewer function calls.
Diffstat (limited to 'modules/gallery/libraries/MY_View.php')
-rw-r--r-- | modules/gallery/libraries/MY_View.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/gallery/libraries/MY_View.php b/modules/gallery/libraries/MY_View.php index ded77792..2230203a 100644 --- a/modules/gallery/libraries/MY_View.php +++ b/modules/gallery/libraries/MY_View.php @@ -23,8 +23,14 @@ class View extends View_Core { /** * Reimplement Kohana 2.3's View::set_global() functionality. */ - public function set_global($key, $value) { - View::$global_data[$key] = $value; + public function set_global($key, $value = NULL) { + if (is_array($key)) { + foreach ($key as $key2 => $value) { + View::$global_data[$key2] = $value; + } + } else { + View::$global_data[$key] = $value; + } } public function is_set($key=null) { |