/**
* Formats the specified response.
* @param Response $response the response to be formatted.
*/
public function format($response)
{
$response->getHeaders()->set('Content-Type', $this->contentType);
if ($this->filename !== null) {
$response->getHeaders()->set('Content-Disposition', "attachment; filename=\"{$this->filename}\"");
}
$response->content = Yii::$app->{$this->converter}->convert($response->data, $this->options);
}