fuel/fuel/core/classes/view.php
public function &get($key = null, $default = null)
	{
		if (func_num_args() === 0 or $key === null)
		{
			return $this->data;
		}
		elseif (array_key_exists($key, $this->data))
		{
			return $this->data[$key];
		}
		elseif (array_key_exists($key, static::$global_data))
		{
			return static::$global_data[$key];
		}

		if (is_null($default) and func_num_args() === 1)
		{
			throw new \OutOfBoundsException('View variable is not set: '.$key);
		}
		else
		{
			// assign it first, you can't return a return value by reference directly!
			$default = \Fuel::value($default);
			return $default;
		}
	}
public function &get($key = null, $default = null)
	{
		if (func_num_args() === 0 or $key === null)
		{
			return $this->data;
		}
		elseif (array_key_exists($key, $this->data))
		{
			return $this->data[$key];
		}
		elseif (array_key_exists($key, static::$global_data))
		{
			return static::$global_data[$key];
		}

		if (is_null($default) and func_num_args() === 1)
		{
			throw new \OutOfBoundsException('View variable is not set: '.$key);
		}
		else
		{
			// assign it first, you can't return a return value by reference directly!
			$default = \Fuel::value($default);
			return $default;
		}
	}
public function & get ( $ key = null , $ default = null ) { if ( func_num_args ( ) === 0 or $ key === null ) { return $ this -> data ; } elseif ( array_key_exists ( $ key , $ this -> data ) ) { return $ this -> data [ $ key ] ; } elseif ( array_key_exists ( $ key , static :: $ global_data ) ) { return static :: $ global_data [ $ key ] ; } if ( is_null ( $ default ) and func_num_args ( ) === 1 ) { throw new \ OutOfBoundsException ( 'View variable is not set: ' . $ key ) ; } else { // assign it first, you can't return a return value by reference directly! $ default = \ Fuel :: value ( $ default ) ; return $ default ; } }
Searches for the given variable and returns its value.
Local variables will be returned before global variables.

$value = $view->get('foo', 'bar');

If the key is not given or null, the entire data array is returned.

If a default parameter is not given and the variable does not
exist, it will throw an OutOfBoundsException.

@param   string  The variable name
@param   mixed   The default value to return
@return  mixed
@throws  OutOfBoundsException
Searches for the given variable and returns its value . Local variables will be returned before global variables .