|
Moodle PHP Documentation 4.1
Moodle 4.1.19+ (Build: 20250711) (5f47dc23ffc)
|
Functions | |
| __construct ($text, $charset=null) | |
| Constructor. | |
| __get ($varname) | |
| Returns the value of a given form variable. | |
| __isset ($varname) | |
| isset() implementation. | |
| __set ($varname, $value) | |
| Sets the value of a given form variable. | |
| __unset ($varname) | |
| Deletes a given form variable. | |
| static | _fallbackToAscii ($str) |
| Transliterate using a built-in ASCII mapping. | |
| _getExists ($array, $varname, &$value) | |
| Fetch the requested variable ($varname) into $value, and return whether or not the variable was set in $array. | |
| static | _iconvToAscii ($str) |
| Transliterate using the iconv extension. | |
| static | _intlToAscii ($str) |
| Transliterate using the Transliterator package. | |
| _loadHTML ($html) | |
| Loads the HTML data. | |
| add ($varname, $value) | |
| Set $varname to $value ONLY if it's not already present. | |
| count () | |
| current () | |
| exists ($varname) | |
| Alias of isset(). | |
| filter ($varname) | |
| Filters a form value so that it can be used in HTML output. | |
| get ($varname, $default=null) | |
| Returns the value of a given form variable. | |
| getBody () | |
| Returns the BODY element, or creates one if it doesn't exist. | |
| getCharset () | |
| Get the charset of the DOM data. | |
| static | getDefaultVariables ($sanitize=false) |
| Returns a Horde_Variables object populated with the form input. | |
| getExists ($varname, &$exists) | |
| Given a variable name, returns the value and sets a variable indicating whether the value exists in the form data. | |
| getHead () | |
| Returns the HEAD element, or creates one if it doesn't exist. | |
| getIterator () | |
| key () | |
| merge ($vars) | |
| Merges a list of variables into the current form variable list. | |
| next () | |
| offsetExists ($field) | |
| Implements isset() for ArrayAccess interface. | |
| offsetGet ($field) | |
| Implements getter for ArrayAccess interface. | |
| offsetSet ($field, $value) | |
| Implements setter for ArrayAccess interface. | |
| offsetUnset ($field) | |
| Implements unset() for ArrayAccess interface. | |
| remove ($varname) | |
| Deletes a given form variable. | |
| returnBody () | |
| Returns the body text in the original charset. | |
| returnHtml (array $opts=array()) | |
| Returns the full HTML text in the original charset. | |
| rewind () | |
| sanitize () | |
| Sanitize the form input. | |
| set ($varname, $value) | |
| Sets the value of a given form variable. | |
| static | toAscii ($str) |
| Transliterates an UTF-8 string to ASCII, replacing non-English characters to their English equivalents. | |
| valid () | |
Variables | |
| array | $_iterator = null |
| Iterator status. | |
| string | $_origCharset |
| Original charset of data. | |
| boolean | $_sanitized = false |
| Has the input been sanitized? | |
| static Transliterator | $_transliterator |
| Transliterator instance. | |
| array | $_vars |
| Array of form variables. | |
| string | $_xmlencoding = '' |
| Encoding tag added to beginning of output. | |
| *See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see | Countable |
| *See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see | http |
| *See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see | http |
| *See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see | http |
| *See the enclosed file LICENSE for license information(LGPL). If you *did not receive this file see | IteratorAggregate |
| __construct | ( | $vars = array(), | |
| $sanitize = null ) |
Constructor.
| string | $text | The text of the HTML document. |
| string | $charset | The charset of the HTML document. |
| Exception |
| array | $vars | The list of form variables (if null, defaults to PHP's $_REQUEST value). If '_formvars' exists, it must be a JSON encoded array that contains the list of allowed form variables. |
| string | $sanitize | Sanitize the input variables? |
| __get | ( | $varname | ) |
Returns the value of a given form variable.
| string | $varname | The form variable name. |
| mixed | The form variable, or null if it doesn't exist. |
| __isset | ( | $varname | ) |
isset() implementation.
| string | $varname | The form variable name. |
| boolean | Does $varname form variable exist? |
| __set | ( | $varname, | |
| $value ) |
Sets the value of a given form variable.
| string | $varname | The form variable name. |
| mixed | $value | The value to set. |
| __unset | ( | $varname | ) |
Deletes a given form variable.
| string | $varname | The form variable name. |
|
staticprotected |
Transliterate using a built-in ASCII mapping.
| string | $str | Input string (UTF-8). |
| string | Transliterated string (UTF-8). |
|
protected |
Fetch the requested variable ($varname) into $value, and return whether or not the variable was set in $array.
| array | $array | The array to search in (usually either $this->_vars or $this->_expected). |
| string | $varname | The name of the variable to look for. |
| mixed | &$value | $varname's value gets assigned to this variable. |
| boolean | Whether or not the variable was set (or, if we've checked $this->_expected, should have been set). |
|
staticprotected |
Transliterate using the iconv extension.
| string | $str | Input string (UTF-8). |
| mixed | Transliterated string (UTF-8), or false on error. |
|
staticprotected |
Transliterate using the Transliterator package.
| string | $str | Input string (UTF-8). |
| mixed | Transliterated string (UTF-8), or false on error. |
|
protected |
Loads the HTML data.
| string | $html | HTML data. |
| add | ( | $varname, | |
| $value ) |
Set $varname to $value ONLY if it's not already present.
| string | $varname | The form variable name. |
| mixed | $value | The value to set. |
| boolean | True if the value was altered. |
| exists | ( | $varname | ) |
Alias of isset().
| filter | ( | $varname | ) |
Filters a form value so that it can be used in HTML output.
| string | $varname | The form variable name. |
| mixed | The filtered variable, or null if it doesn't exist. |
| get | ( | $varname, | |
| $default = null ) |
Returns the value of a given form variable.
| string | $varname | The form variable name. |
| string | $default | The default form variable value. |
| mixed | The form variable, or $default if it doesn't exist. |
| getBody | ( | ) |
Returns the BODY element, or creates one if it doesn't exist.
| DOMElement | BODY element. |
| getCharset | ( | ) |
Get the charset of the DOM data.
| string | Charset of DOM data. |
|
static |
Returns a Horde_Variables object populated with the form input.
| string | $sanitize | Sanitize the input variables? |
| Horde_Variables | Variables object. |
| getExists | ( | $varname, | |
| & | $exists ) |
Given a variable name, returns the value and sets a variable indicating whether the value exists in the form data.
| string | $varname | The form variable name. |
| boolean | &$exists | Reference to variable that will indicate whether $varname existed in form data. |
| mixed | The form variable, or null if it doesn't exist. |
| getHead | ( | ) |
Returns the HEAD element, or creates one if it doesn't exist.
| DOMElement | HEAD element. |
| merge | ( | $vars | ) |
Merges a list of variables into the current form variable list.
| array | $vars | Form variables. |
| offsetExists | ( | $field | ) |
Implements isset() for ArrayAccess interface.
| offsetGet | ( | $field | ) |
Implements getter for ArrayAccess interface.
| offsetSet | ( | $field, | |
| $value ) |
Implements setter for ArrayAccess interface.
| offsetUnset | ( | $field | ) |
Implements unset() for ArrayAccess interface.
| remove | ( | $varname | ) |
Deletes a given form variable.
| returnBody | ( | ) |
Returns the body text in the original charset.
| string | HTML text. |
| returnHtml | ( | array | $opts = array() | ) |
Returns the full HTML text in the original charset.
| array | $opts | Additional options: (since 2.1.0)
|
| string | HTML text. |
| set | ( | $varname, | |
| $value ) |
Sets the value of a given form variable.
|
static |
Transliterates an UTF-8 string to ASCII, replacing non-English characters to their English equivalents.
Note: there is no guarantee that the output string will be ASCII-only, since any non-ASCII character not in the transliteration list will be ignored.
| string | $str | Input string (UTF-8). |
| string | Transliterated string (UTF-8). |