Here is my code:
class Controller_Call extends Controller {
public $template = 'tpl/default';
public function before() {
parent::before();
$this->request->headers('Content-Type', 'text/xml');
$this->template = View::factory($this->template);
}
public function action_index() {
$this->template->response = '<say>Hey! How are you budy!</say>';
}
public function after() {
$this->request->headers('Content-Type', 'text/xml');
$this->response->body( $this->template );
parent::after();
$this->request->headers('Content-Type', 'text/xml');
}
}
When I load the page in firefox and I look at the Content-Type, I get text/html.
Why is that?
Thank you very much in advance
You need to set the headers on the response: