<?php /* @var $this \yii\web\View */ /* @var $content string */ //use yii\helpers\Html; Yii::$app->response->format = \yii\web\Response::FORMAT_RAW; Yii::$app->response->headers->set('content-type', 'application/xml;charset=utf-8'); $this->beginPage(); echo $content; $this->endPage();