PHP Class yii\web\XmlResponseFormatter

It is used by Response to format response data.
Since: 2.0
Author: Qiang Xue ([email protected])
Inheritance: extends yii\base\Component, implements yii\web\ResponseFormatterInterface
Afficher le fichier Open project: yiisoft/yii2 Class Usage Examples

Méthodes publiques

Свойство Type Description
$contentType the Content-Type header for the response
$encoding the XML encoding. If not set, it will use the value of [[Response::charset]].
$itemTag the name of the elements that represent the array elements with numeric keys.
$rootTag the name of the root element.
$useTraversableAsArray whether to interpret objects implementing the [[\Traversable]] interface as arrays. Defaults to true.
$version the XML version

Méthodes publiques

Méthode Description
format ( Response $response ) Formats the specified response.

Méthodes protégées

Méthode Description
buildXml ( DOMElement $element, mixed $data )
formatScalarValue ( integer | string | boolean $value ) : string Formats scalar value to use in XML text node

Method Details

buildXml() protected méthode

protected buildXml ( DOMElement $element, mixed $data )
$element DOMElement
$data mixed

format() public méthode

Formats the specified response.
public format ( Response $response )
$response Response the response to be formatted.

formatScalarValue() protected méthode

Formats scalar value to use in XML text node
Since: 2.0.11
protected formatScalarValue ( integer | string | boolean $value ) : string
$value integer | string | boolean
Résultat string

Property Details

$contentType public_oe property

the Content-Type header for the response
public $contentType

$encoding public_oe property

the XML encoding. If not set, it will use the value of [[Response::charset]].
public $encoding

$itemTag public_oe property

the name of the elements that represent the array elements with numeric keys.
public $itemTag

$rootTag public_oe property

the name of the root element.
public $rootTag

$useTraversableAsArray public_oe property

whether to interpret objects implementing the [[\Traversable]] interface as arrays. Defaults to true.
Since: 2.0.7
public $useTraversableAsArray

$version public_oe property

the XML version
public $version