Public Member Functions | Protected Member Functions

Robo47_View_Helper_Globals Class Reference

List of all members.

Public Member Functions

 Globals ($global, $name=null, $default=null, $escape=true)
 Escaping is only used on strings! not on arrays !

Protected Member Functions

 _checkGlobal ($global, $name, $default)
 _getGlobal ($global, $name=null, $default=null)

Detailed Description

Definition at line 31 of file Globals.php.


Member Function Documentation

Robo47_View_Helper_Globals::_checkGlobal ( global,
name,
default 
) [protected]
Parameters:
string $global
string|null $name
mixed $default

Definition at line 63 of file Globals.php.

References _getGlobal().

Referenced by Globals().

    {
        $lglobal = strtolower($global);
        switch ($lglobal) {
            case 'server':
            case 'env':
            case 'post':
            case 'get':
            case 'cookie':
            case 'session':
                return $this->_getGlobal(
                    '_' . strtoupper($global),
                    $name,
                    $default
                );
                break;
            default:
                $message = 'Unknown global "' . $global . '"';
                throw new Robo47_View_Helper_Exception($message);
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Robo47_View_Helper_Globals::_getGlobal ( global,
name = null,
default = null 
) [protected]
Parameters:
string $global
string $name
mixed $default
Returns:
mixed

Definition at line 92 of file Globals.php.

Referenced by _checkGlobal().

    {
        if (!isset($GLOBALS[$global])) {
            return $default;
        }
        if (null === $name) {
            return $GLOBALS[$global];
        }
        if (isset($GLOBALS[$global][$name])) {
            return $GLOBALS[$global][$name];
        } else {
            return $default;
        }
    }

Here is the caller graph for this function:

Robo47_View_Helper_Globals::Globals ( global,
name = null,
default = null,
escape = true 
)

Escaping is only used on strings! not on arrays !

Parameters:
string $global
string $name
mixed $default
bool $escape
Returns:
Robo47_View_Helper_Globals|mixed

Definition at line 44 of file Globals.php.

References _checkGlobal().

    {
        $value = $this->_checkGlobal($global, $name, $default);

        if (true === $escape) {
            if (is_string($value)) {
                $value = $this->view->escape($value);
            }
        }
        return $value;
    }

Here is the call graph for this function:


The documentation for this class was generated from the following file: