mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-20 03:19:13 -04:00
Reimplemented Kohana 2.3's View::set_global() with array support.
Allows for cleaner code and fewer function calls.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user