hgGridcommon
public abstract class hgGridcommon
| Field Summary | |
|---|---|
| static mixed | |
| static mixed | |
| static mixed | |
| static mixed | |
| static mixed | |
| static mixed | |
| Method Summary | |
|---|---|
| static string | toXml(array data, string rootNodeName, SimpleXMLElement xml, str encoding, bool cdata) Function for converting to an XML document. |
| static string | quote(string string, boolean whether, mixed js, bool forUrl) Quotes a javascript string. |
| static string | encode(mixed PHP, mixed value) Encodes a PHP variable into javascript representation. |
| static array | decode(string json) Decodes json string to PHP array. |
| static mixed | Strip(mixed value) Strip slashes from a varaible if PHP magic quotes are on |
| static string | generatePattern(string dateformat) Internal function which generates regex pattern from date pattern |
| static array | date_parse(string dateformat, string date, boolean localize) Converts the string date to array by using the pattern generated by generatePattern() function |
| static mixed | parseDate(string patternFrom, string date, string patternTo) Parses a $format and $date value and return the date formated via $newformat. |
| static mixed | GetParam(string parameter_name, string default_value) Return the value from POST or from GET |
| static array | array_extend(array a, array b) "Extend" recursively array $a with array $b values (no deletion in $a, just added and updated values) |
| static void | phpTojsDate(string phpdate) Convert the php date string to Java Script date string |
| static string|false | sprintfn(string format, array args) version of sprintf for cases where named arguments are desired (php syntax)with sprintf: sprintf('second: %2$s ; first: %1$s', '1st', '2nd');with sprintfn: sprintfn('second: %second$s ; first: %first$s', array( 'first' => '1st', 'second'=> '2nd' )); |
public static mixed $days = array(...)
public static mixed $days3 = array(...)
public static mixed $month = array(...)
public static mixed $month3 = array(...)
public static mixed $patrVal = ""
public static mixed $types = array(...)
public static string toXml(array data, string rootNodeName, SimpleXMLElement xml, str encoding, bool cdata)
Function for converting to an XML document. Pass in a multi dimensional array or object and this recrusively loops through and builds up an XML document.
public static string quote(string string, boolean whether, mixed js, bool forUrl)
Quotes a javascript string. After processing, the string can be safely enclosed within a pair of quotation marks and serve as a javascript string.
public static string encode(mixed PHP, mixed value)
Encodes a PHP variable into javascript representation.
Example:
$options=array('key1'=>true,'key2'=>123,'key3'=>'value');
echo hgGridcommon::encode($options);
// The following javascript code would be generated:
// {'key1':true,'key2':123,'key3':'value'}
For highly complex data structures use jsonEncode and jsonDecode
to serialize and unserialize.
public static array decode(string json)
Decodes json string to PHP array. The function is used when the encoding is diffrent from utf-8
public static mixed Strip(mixed value)
Strip slashes from a varaible if PHP magic quotes are on
public static string generatePattern(string dateformat)
Internal function which generates regex pattern from date pattern
public static array date_parse(string dateformat, string date, boolean localize)
Converts the string date to array by using the pattern generated by generatePattern() function
public static mixed parseDate(string patternFrom, string date, string patternTo)
Parses a $format and $date value and return the date formated via $newformat. If the $patternTo is not set return the timestamp.
public static mixed GetParam(string parameter_name, string default_value)
Return the value from POST or from GET
public static array array_extend(array a, array b)
"Extend" recursively array $a with array $b values (no deletion in $a, just added and updated values)
public static void phpTojsDate(string phpdate)
Convert the php date string to Java Script date string
public static string|false sprintfn(string format, array args)
version of sprintf for cases where named arguments are desired (php syntax)
with sprintf: sprintf('second: %2$s ; first: %1$s', '1st', '2nd');
with sprintfn: sprintfn('second: %second$s ; first: %first$s', array( 'first' => '1st', 'second'=> '2nd' ));