Reimplemented Kohana 2.3's View::set_global() with array support.

Allows for cleaner code and fewer function calls.
This commit is contained in:
Joe7
2011-01-02 18:59:23 +01:00
committed by Bharat Mediratta
parent e6a5f39b91
commit cfaa62370e
4 changed files with 35 additions and 26 deletions

View File

@@ -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) {