Static Public Member Functions | |
| static | cutArray (array $arr, $nb, $presKey=true) |
| static | html2Text ($html) |
| static | htmlTag ($tag, array $attributes, $content=null) |
| static | mailTo ($email, $name=null, array $attributes=array()) |
| static | htmlObfuscate ($text) |
| static | htmlAttribute (array $prm) |
| static | htmlOut ($val, $key=false) |
| static | htmlDeOut ($val, $key=false) |
| static | htmlChars () |
| static | htmlIn ($val) |
| static | getModuleName ($className) |
| static | initTabNumPair (array &$vars, $finalName= 'final') |
| static | getIcon (array $prm) |
| static | formatDate ($date, $type= 'date', $len= 'short2', $htmlOut=true) |
| static | img ($prm, $absolute=false) |
| static | render (array $prm) |
| static | getValInArray (array $source, array $keys) |
| static | urlify ($text, $ignore=null) |
| static | jsEncode ($vars) |
| static | randomStr ($len=10, $ignore=null) |
| static | isContained (array $url, array $checks) |
Static Protected Attributes | |
| static | $date |
Static Private Attributes | |
| static | $htmlChars = null |
functions utils
Definition at line 10 of file utils.class.php.
| static cutArray | ( | array $ | arr, | |
| $ | nb, | |||
| $ | presKey = true | |||
| ) | [static] |
Split an array with
| array | $arr Array to split | |
| int | $nb Count element for the first part | |
| bool | $presKey True if the key must be preserved |
Definition at line 20 of file utils.class.php.
| static formatDate | ( | $ | date, | |
| $ | type = 'date', |
|||
| $ | len = 'short2', |
|||
| $ | htmlOut = true | |||
| ) | [static] |
Format a date, using helper_date
| int|string | $date Int to directly set a timestamp or strong for a date to format (compatible with strtotime) | |
| string | $type Format needed | |
| string | $len Format length needed |
Definition at line 298 of file utils.class.php.
| static getIcon | ( | array $ | prm | ) | [static] |
Get an icon
| array | $prm Icon configuration. Available key:
|
Definition at line 250 of file utils.class.php.
| static getModuleName | ( | $ | className | ) | [static] |
Get the module name from the class name
| string | $className |
Definition at line 214 of file utils.class.php.
| static getValInArray | ( | array $ | source, | |
| array $ | keys | |||
| ) | [static] |
Get a value in an array, by specifing the path to it
| array | $source The array source | |
| array | $keys The path in the $source array, numercally indexed |
Definition at line 358 of file utils.class.php.
| static html2Text | ( | $ | html | ) | [static] |
Transform HTML to text, using html2text library
| string | $html The HTML string to transform |
Definition at line 33 of file utils.class.php.
| static htmlAttribute | ( | array $ | prm | ) | [static] |
Create a string for HTML attribute
| array | $prm Array for create the attribue |
Definition at line 90 of file utils.class.php.
| static htmlChars | ( | ) | [static] |
| static htmlDeOut | ( | $ | val, | |
| $ | key = false | |||
| ) | [static] |
Opposite of htmlOut
| array|string | $val | |
| bool | $key In case of an array, indicate if the keys should also be processed |
Definition at line 128 of file utils.class.php.
| static htmlIn | ( | $ | val | ) | [static] |
Used to retrieve the data from the request
| array|string | $val |
Definition at line 199 of file utils.class.php.
| static htmlObfuscate | ( | $ | text | ) | [static] |
Create the HTML string to obfuscate a text (usually an email)
| string | $text |
Definition at line 77 of file utils.class.php.
| static htmlOut | ( | $ | val, | |
| $ | key = false | |||
| ) | [static] |
Convert html entities. If array provided, all the data will be converted
| array|string | $val | |
| bool | $key In case of an array, indicate if the keys should also be processed |
Definition at line 105 of file utils.class.php.
| static htmlTag | ( | $ | tag, | |
| array $ | attributes, | |||
| $ | content = null | |||
| ) | [static] |
Create a HTML tag
| string | $tag Tag name | |
| array | $attributes attributes for the tag used by htmlAttribute | |
| null|string | $content Eventual tag content |
Definition at line 46 of file utils.class.php.
| static img | ( | $ | prm, | |
| $ | absolute = false | |||
| ) | [static] |
Create the image tag for an image (in the img directory)
| string|array | $prm Src string or array of attribute for the img tag |
Definition at line 319 of file utils.class.php.
| static initTabNumPair | ( | array &$ | vars, | |
| $ | finalName = 'final' | |||
| ) | [static] |
Transform a numeric pair array to a string key array
| array | $vars Variable array to transfer | |
| string | $finalName Name for the last key, if needed |
Definition at line 227 of file utils.class.php.
| static isContained | ( | array $ | url, | |
| array $ | checks | |||
| ) | [static] |
Indicate if a configuration array is contained in the url
| array | $url | |
| array | $checks |
Definition at line 454 of file utils.class.php.
| static jsEncode | ( | $ | vars | ) | [static] |
Encodes an array to be used as a Json object. Keeps functions declaration
| array | $vars |
Definition at line 405 of file utils.class.php.
| static mailTo | ( | $ | email, | |
| $ | name = null, |
|||
| array $ | attributes = array() | |||
| ) | [static] |
Create a mailto HTML tag to send an email, with obfuscating
| string | $email The email | |
| string|null | $name The name to show as text. If null, $email will be used | |
| array | $attributes Attributes to add to the html tag |
Definition at line 63 of file utils.class.php.
| static randomStr | ( | $ | len = 10, |
|
| $ | ignore = null | |||
| ) | [static] |
Create a random string
| int | $len Length of the returned string | |
| null|string | $ignore Character to exclude from the random string |
Definition at line 431 of file utils.class.php.
| static render | ( | array $ | prm | ) | [static] |
Render a tpl element
| array | $prm Array configuration, with at least the module and action keys |
Definition at line 347 of file utils.class.php.
| static urlify | ( | $ | text, | |
| $ | ignore = null | |||
| ) | [static] |
Clean a string to be used in an URL
| string | $text | |
| string | $ignore Ignore charater list |
Definition at line 376 of file utils.class.php.
$date [static, protected] |
Definition at line 287 of file utils.class.php.
$htmlChars = null [static, private] |
Definition at line 151 of file utils.class.php.
1.7.1