JUtility
JUtility is a utility functions class
package |
Joomla.Platform |
---|---|
subpackage |
Utilities |
since |
11.1 |
Methods
array_unshift_ref
Prepend a reference to an element to the beginning of an array.
array_unshift_ref( &$array, &$value) : integer
Renumbers numeric keys, so $value is always inserted to $array[0]
deprecated |
12.1 |
---|---|
see |
http://www.php.net/manual/en/function.array-unshift.php#40270 |
note |
PHP no longer supports array_unshift of references. |
since |
11.1 |
Arguments
- $array
- $value
Response
integer
dump
Method to dump the structure of a variable for debugging purposes
dump( &$var, boolean $htmlSafe = true) : string
deprecated |
12.1 |
---|---|
since |
11.1 |
Arguments
- $var
- $htmlSafe
boolean
True to ensure all characters are htmlsafe
Response
string
getHash
Provides a secure hash based on a seed
getHash(string $seed) : string
deprecated |
12.1 Use JApplication::getHash() instead. |
---|---|
see | \JApplication::getHash() |
since |
11.1 |
Arguments
- $seed
string
Seed string.
Response
string
getToken
Method to determine a hash for anti-spoofing variable names
getToken(boolean $forceNew = false) : string
deprecated |
12.1 Use JSession::getFormToken() instead |
---|---|
see | \JSession::getFormToken() |
since |
11.1 |
Arguments
- $forceNew
boolean
Force creation of a new token.
Response
string
Hashed var name
isWinOS
Method to determine if the host OS is Windows.
isWinOS() : boolean
parseAttributes
Method to extract key/value pairs out of a string with XML style attributes
parseAttributes(string $string) : array
since |
11.1 |
---|
Arguments
- $string
string
String containing XML style attributes
Response
array
Key/Value pairs for the attributes
return_bytes
Return the byte value of a particular string
return_bytes(string $val) : integer
deprecated |
12.1 |
---|---|
see | \JHtmlNumber::bytes |
since |
11.1 |
Arguments
- $val
string
String optionally with G, M or K suffix
Response
integer
Size in bytes
sendAdminMail
Sends mail to administrator for approval of a user submission
sendAdminMail(string $adminName, string $adminEmail, string $email, string $type, string $title, string $author, string $url = null) : boolean
deprecated |
12.1 |
---|---|
see | \JMail::sendAdminMail() |
since |
11.1 |
Arguments
- $adminName
string
Name of administrator- $adminEmail
string
Email address of administratorstring
[NOT USED]- $type
string
Type of item to approve- $title
string
Title of item to approve- $author
string
Author of item to approve- $url
string
url
Response
boolean
True on success
sendMail
Mail function (uses phpMailer)
sendMail(string $from, string $fromname, mixed $recipient, string $subject, string $body, boolean $mode, mixed $cc = null, mixed $bcc = null, mixed $attachment = null, mixed $replyto = null, mixed $replytoname = null) : boolean
deprecated |
12.1 |
---|---|
see | \JMail::sendMail() |
since |
11.1 |
Arguments
- $from
string
From email address- $fromname
string
From name- $recipient
mixed
Recipient email address(es)- $subject
string
Email subject- $body
string
Message body- $mode
boolean
False = plain text, true = HTML- $cc
mixed
CC email address(es)- $bcc
mixed
BCC email address(es)- $attachment
mixed
Attachment file name(s)- $replyto
mixed
Reply to email address(es)- $replytoname
mixed
Reply to name(s)
Response
boolean
True on success