|
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) |
|
functions utils
Definition at line 10 of file utils.class.php.
◆ cutArray()
static cutArray |
( |
array |
$arr, |
|
|
|
$nb, |
|
|
|
$presKey = true |
|
) |
| |
|
static |
Split an array with
- Parameters
-
array | $arr | Array to split |
int | $nb | Count element for the first part |
bool | $presKey | True if the key must be preserved |
- Returns
- array First element will be the first splitted part, Second the rest
Definition at line 20 of file utils.class.php.
◆ formatDate()
static formatDate |
( |
|
$date, |
|
|
|
$type = 'date' , |
|
|
|
$len = 'short2' , |
|
|
|
$htmlOut = true |
|
) |
| |
|
static |
Format a date, using helper_date
- Parameters
-
int | string | $date | Int to directly set a timestamp or strong for a date to format (compatible with strtotime) |
string | true | $type | Format needed or true if you want to use formatDirect |
string | $len | Format length needed or date format if using formatDirect |
- Returns
- string The date formatted
- See also
- helper_date::format
Definition at line 298 of file utils.class.php.
◆ getIcon()
static getIcon |
( |
array |
$prm | ) |
|
|
static |
Get an icon
- Parameters
-
array | $prm | Icon configuration. Available key:
- string name: action name (required)
- string type: icon type
- bool imgTag: true if the return should be a valid html img tag. if false, will return he url
- string alt: alt text for the image, used only if imgTag = true
- array attr: attributes added to the img tag
|
- Returns
- unknown
Definition at line 250 of file utils.class.php.
◆ getModuleName()
static getModuleName |
( |
|
$className | ) |
|
|
static |
Get the module name from the class name
- Parameters
-
- Returns
- string
Definition at line 214 of file utils.class.php.
◆ getValInArray()
static getValInArray |
( |
array |
$source, |
|
|
array |
$keys |
|
) |
| |
|
static |
Get a value in an array, by specifing the path to it
- Parameters
-
array | $source | The array source |
array | $keys | The path in the $source array, numercally indexed |
- Returns
- mixed
Definition at line 365 of file utils.class.php.
◆ html2Text()
static html2Text |
( |
|
$html | ) |
|
|
static |
Transform HTML to text, using html2text library
- Parameters
-
string | $html | The HTML string to transform |
- Returns
- string
Definition at line 33 of file utils.class.php.
◆ htmlAttribute()
static htmlAttribute |
( |
array |
$prm | ) |
|
|
static |
Create a string for HTML attribute
- Parameters
-
array | $prm | Array for create the attribue |
- Returns
- string
Definition at line 90 of file utils.class.php.
◆ htmlChars()
Get the HTML translation table
- Returns
- array
Definition at line 158 of file utils.class.php.
◆ htmlDeOut()
static htmlDeOut |
( |
|
$val, |
|
|
|
$key = false |
|
) |
| |
|
static |
Opposite of htmlOut
- Parameters
-
array | string | $val | |
bool | $key | In case of an array, indicate if the keys should also be processed |
- Returns
- array|string
Definition at line 128 of file utils.class.php.
◆ htmlIn()
Used to retrieve the data from the request
- Parameters
-
- Returns
- array|string
Definition at line 199 of file utils.class.php.
◆ htmlObfuscate()
static htmlObfuscate |
( |
|
$text | ) |
|
|
static |
Create the HTML string to obfuscate a text (usually an email)
- Parameters
-
- Returns
- string
Definition at line 77 of file utils.class.php.
◆ htmlOut()
static htmlOut |
( |
|
$val, |
|
|
|
$key = false |
|
) |
| |
|
static |
Convert html entities. If array provided, all the data will be converted
- Parameters
-
array | string | $val | |
bool | $key | In case of an array, indicate if the keys should also be processed |
- Returns
- array|string
Definition at line 105 of file utils.class.php.
◆ htmlTag()
static htmlTag |
( |
|
$tag, |
|
|
array |
$attributes, |
|
|
|
$content = null |
|
) |
| |
|
static |
Create a HTML tag
- Parameters
-
string | $tag | Tag name |
array | $attributes | attributes for the tag used by htmlAttribute |
null | string | $content | Eventual tag content |
- Returns
- string
Definition at line 46 of file utils.class.php.
◆ img()
static img |
( |
|
$prm, |
|
|
|
$absolute = false |
|
) |
| |
|
static |
Create the image tag for an image (in the img directory)
- Parameters
-
string | array | $prm | Src string or array of attribute for the img tag |
- Returns
- string The HTML img tag
Definition at line 326 of file utils.class.php.
◆ initTabNumPair()
static initTabNumPair |
( |
array & |
$vars, |
|
|
|
$finalName = 'final' |
|
) |
| |
|
static |
Transform a numeric pair array to a string key array
- Parameters
-
array | $vars | Variable array to transfer |
string | $finalName | Name for the last key, if needed |
Definition at line 227 of file utils.class.php.
◆ isContained()
static isContained |
( |
array |
$url, |
|
|
array |
$checks |
|
) |
| |
|
static |
Indicate if a configuration array is contained in the url
- Parameters
-
- Returns
- bool True if a line in $checks matches the $url
Definition at line 478 of file utils.class.php.
◆ jsEncode()
Encodes an array to be used as a Json object. Keeps functions declaration
- Parameters
-
- Returns
- string
Definition at line 414 of file utils.class.php.
◆ jsEncodeSearchFunc()
static jsEncodeSearchFunc |
( |
array & |
$vars, |
|
|
& |
$startFunc = 1 |
|
) |
| |
|
staticprotected |
Internal function used from jsEndcode to deeply search for function
- Parameters
-
- Returns
- array
Definition at line 433 of file utils.class.php.
◆ mailTo()
static mailTo |
( |
|
$email, |
|
|
|
$name = null , |
|
|
array |
$attributes = array() |
|
) |
| |
|
static |
Create a mailto HTML tag to send an email, with obfuscating
- Parameters
-
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 |
- Returns
- string
Definition at line 63 of file utils.class.php.
◆ randomStr()
static randomStr |
( |
|
$len = 10 , |
|
|
|
$ignore = null |
|
) |
| |
|
static |
Create a random string
- Parameters
-
int | $len | Length of the returned string |
null | string | $ignore | Character to exclude from the random string |
- Returns
- string
Definition at line 455 of file utils.class.php.
◆ render()
static render |
( |
array |
$prm | ) |
|
|
static |
Render a tpl element
- Parameters
-
array | $prm | Array configuration, with at least the module and action keys |
- Returns
- string The rendered element
Definition at line 354 of file utils.class.php.
◆ urlify()
static urlify |
( |
|
$text, |
|
|
|
$ignore = null |
|
) |
| |
|
static |
Clean a string to be used in an URL
- Parameters
-
string | $text | |
string | $ignore | Ignore charater list |
- Returns
- string
Definition at line 383 of file utils.class.php.
◆ $date
◆ $htmlChars
The documentation for this class was generated from the following file: