PHP Класс yii\web\XmlResponseFormatter

It is used by Response to format response data.
С версии: 2.0
Автор: Qiang Xue ([email protected])
Наследование: extends yii\base\Component, implements yii\web\ResponseFormatterInterface
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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

Открытые методы

Метод Описание
format ( Response $response ) Formats the specified response.

Защищенные методы

Метод Описание
buildXml ( DOMElement $element, mixed $data )
formatScalarValue ( integer | string | boolean $value ) : string Formats scalar value to use in XML text node

Описание методов

buildXml() защищенный Метод

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

format() публичный Метод

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

formatScalarValue() защищенный Метод

Formats scalar value to use in XML text node
С версии: 2.0.11
protected formatScalarValue ( integer | string | boolean $value ) : string
$value integer | string | boolean
Результат string

Описание свойств

$contentType публичное свойство

the Content-Type header for the response
public $contentType

$encoding публичное свойство

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

$itemTag публичное свойство

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

$rootTag публичное свойство

the name of the root element.
public $rootTag

$useTraversableAsArray публичное свойство

whether to interpret objects implementing the [[\Traversable]] interface as arrays. Defaults to true.
С версии: 2.0.7
public $useTraversableAsArray

$version публичное свойство

the XML version
public $version