Use case: just one action which should return a plain (text) content as-is:
public function actionAsXML()
{
$this->layout = false;
Yii::$app->response->format = Response::FORMAT_XML;
return ['aaa' => [1, 2, 3, 4]];;
}
Pre-defined response formats are:
FORMAT_HTM...