public static function getData($key = null) {
        if (!isset($key)) {
            return self::$viewContext->viewData;
        }
        else {
            return isset(self::$viewContext->viewData[$key]) ? self::$viewContext->viewData[$key] : null;
        }
    }
public static function getData($key = null) {
        if (!isset($key)) {
            return self::$viewContext->viewData;
        }
        else {
            return isset(self::$viewContext->viewData[$key]) ? self::$viewContext->viewData[$key] : null;
        }
    }
public static function getData ( $ key = null ) { if ( ! isset ( $ key ) ) { return self :: $ viewContext -> viewData ; } else { return isset ( self :: $ viewContext -> viewData [ $ key ] ) ? self :: $ viewContext -> viewData [ $ key ] : null ; } }
Gets the data with the specified key.
If the specified key does not exist, function returns null.
If no key is specified, returns all data.

@param string $key The key to get the data.

@return mixed|array|null
Gets the data with the specified key . If the specified key does not exist function returns null . If no key is specified returns all data .