MediaWiki  1.29.1
XmlJsCode Class Reference

A wrapper class which causes Xml::encodeJsVar() and Xml::encodeJsCall() to interpret a given string as being a JavaScript expression, instead of string data. More...

Public Member Functions

 __construct ( $value)
 

Public Attributes

 $value
 

Detailed Description

A wrapper class which causes Xml::encodeJsVar() and Xml::encodeJsCall() to interpret a given string as being a JavaScript expression, instead of string data.

Example:

Xml::encodeJsVar( new XmlJsCode( 'a + b' ) );

Returns "a + b".

Note
As of 1.21, XmlJsCode objects cannot be nested inside objects or arrays. The sole exception is the $args argument to Xml::encodeJsCall() because Xml::encodeJsVar() is called for each individual element in that array.
Since
1.17

Definition at line 847 of file Xml.php.

Constructor & Destructor Documentation

◆ __construct()

XmlJsCode::__construct (   $value)

Definition at line 850 of file Xml.php.

References $value, and value.

Member Data Documentation

◆ $value

XmlJsCode::$value

Definition at line 848 of file Xml.php.

Referenced by __construct().


The documentation for this class was generated from the following file: