Yii2 REST API remove tag

$xml = new yiiwebXmlResponseFormatter;
$xml
->rootTag = 'Response';
       
Yii::$app->response->format = 'custom_xml';
Yii::$app->response->formatters['custom_xml'] = $xml;
       
return ['customer' => ['name' => 'John Smith']];

Leave a comment

Your email address will not be published. Required fields are marked *