|
MediaWiki master
|
A wrapper class which causes Html::encodeJsVar() and Html::encodeJsCall() (as well as their Xml::* counterparts) to interpret a given string as being a JavaScript expression, instead of string data. More...
Public Member Functions | |
| __construct (string $value) | |
Static Public Member Functions | |
| static | encodeObject ( $obj, $pretty=false) |
| Encode an object containing HtmlJsCode objects. | |
Public Attributes | |
| string | $value |
A wrapper class which causes Html::encodeJsVar() and Html::encodeJsCall() (as well as their Xml::* counterparts) to interpret a given string as being a JavaScript expression, instead of string data.
This returns "a + b".
Definition at line 28 of file HtmlJsCode.php.
| MediaWiki\Html\HtmlJsCode::__construct | ( | string | $value | ) |
Definition at line 31 of file HtmlJsCode.php.
References MediaWiki\Html\HtmlJsCode\$value.
|
static |
Encode an object containing HtmlJsCode objects.
This takes an object or associative array where (some of) the values are HtmlJsCode objects, and re-encodes it as a single HtmlJsCode object.
| object | array | $obj | Object or associative array to encode |
| bool | $pretty | If true, add non-significant whitespace to improve readability. |
Definition at line 47 of file HtmlJsCode.php.
References MediaWiki\Html\HtmlJsCode\$value, and MediaWiki\Html\Html\encodeJsVar().
| string MediaWiki\Html\HtmlJsCode::$value |
Definition at line 29 of file HtmlJsCode.php.
Referenced by MediaWiki\Html\HtmlJsCode\__construct(), and MediaWiki\Html\HtmlJsCode\encodeObject().