tags:

views:

46

answers:

1

Hello.

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.

+5  A: 

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

Jacob Relkin
+1 Good catch :)
Sarfraz
Awesome! +1 and correct.
Gabriel Bianconi