Kohana_Twig::set_global PHP Method

set_global() public static method

The name is a bit of a misnomer, since Twig has no real concept of "global" variables, just one context available to the entire view structure. However, it is implemented to provide an API similar to Kohana_View, as well as to allow passing a default set of values (perhaps from the 'context' configuration) that can be overridden by set(). The global data persists across environments.
public static set_global ( $key, $value = NULL ) : View
return View
    public static function set_global($key, $value = NULL)
    {
        if (is_array($key)) {
            foreach ($key as $key2 => $value) {
                Twig::$_global_data[$key2] = $value;
            }
        } else {
            Twig::$_global_data[$key] = $value;
        }
    }