Gabriel Bianconi
Gabriel Bianconi

Reputation: 1189

Change Content-type header in Kohana3

I'm trying to create a rss feed in my Kohana app. I did this in my controller:

public function action_rss()
{
    $games = ORM::factory('game')
        ->order_by('name','ASC')
        ->find_all()
        ->as_array();

    $view = View::factory('home/rss')
        ->bind('games', $games);

    $this->request->$headers['Content-type'] = 'application/rss+xml; charset=UTF-8';

    $this->request->response = $view;
}

It doesn't work (when I remove the $headers line, it does, but with a html type). How can I send the response as rss+xml ?

Thank you.

Upvotes: 1

Views: 848

Answers (1)

Jacob Relkin
Jacob Relkin

Reputation: 163228

This should work if you get rid of the $ in $headers.

Upvotes: 6

Related Questions