$xml = new yiiwebXmlResponseFormatter;$xml->rootTag = ‘Response’; Yii::$app->response->format = ‘custom_xml’;Yii::$app->response->formatters[‘custom_xml’] = $xml; return [‘customer’ => [‘name’ => ‘John Smith’]];
PHP, LARAVEL, YII, HTML, CSS. TECH BLOG !
$xml = new yiiwebXmlResponseFormatter;$xml->rootTag = ‘Response’; Yii::$app->response->format = ‘custom_xml’;Yii::$app->response->formatters[‘custom_xml’] = $xml; return [‘customer’ => [‘name’ => ‘John Smith’]];