MediaWiki
REL1_39
XmlJsCode.php
Go to the documentation of this file.
1
<?php
40
class
XmlJsCode
{
41
public
$value
;
42
43
public
function
__construct
( $value ) {
44
$this->value =
$value
;
45
}
46
59
public
static
function
encodeObject
( $obj, $pretty =
false
) {
60
$parts = [];
61
foreach
( $obj as $key =>
$value
) {
62
$parts[] =
63
( $pretty ?
' '
:
''
) .
64
Xml::encodeJsVar( $key, $pretty ) .
65
( $pretty ?
': '
:
':'
) .
66
Xml::encodeJsVar(
$value
, $pretty );
67
}
68
return
new
self
(
69
'{'
.
70
( $pretty ?
"\n"
:
''
) .
71
implode( $pretty ?
",\n"
:
','
, $parts ) .
72
( $pretty ?
"\n"
:
''
) .
73
'}'
74
);
75
}
76
}
XmlJsCode
A wrapper class which causes Xml::encodeJsVar() and Xml::encodeJsCall() to interpret a given string a...
Definition
XmlJsCode.php:40
XmlJsCode\$value
$value
Definition
XmlJsCode.php:41
XmlJsCode\encodeObject
static encodeObject( $obj, $pretty=false)
Encode an object containing XmlJsCode objects.
Definition
XmlJsCode.php:59
XmlJsCode\__construct
__construct( $value)
Definition
XmlJsCode.php:43
includes
xml
XmlJsCode.php
Generated on Fri Dec 20 2024 15:35:45 for MediaWiki by
1.10.0