Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

[SOLVED] Action 'rss' isn't allowed on class ArticleHolder_Controller


Go to End


3 Posts   4321 Views

Avatar
Stefanovic72

Community Member, 3 Posts

29 November 2013 at 3:31am

Edited: 29/11/2013 3:33am

Hello,

I just started to learn Silvesrstripe. I follow the tutorials and unfortunately I encounter a problem by doing the steps in the second tutorial (extending-a-basic-site).
When I try to add a RSS feed to my news section I get this error when I try to open the rss in my browser:

Action 'rss' isn't allowed on class ArticleHolder_Controller.

I cannot see what I've done wrong. This is the code of the ArticleHolder_Controller:

<?php
class ArticleHolder extends Page {
    private static $allowed_children = array('ArticlePage');


}
class ArticleHolder_Controller extends Page_Controller {

    public function rss() {
        $rss = new RSSFeed($this->Children(), $this->Link(), "The coolest news around");
        return $rss->outputToBrowser();
    }

}

Any help is very much appreciated!

Stefan

Avatar
Stefanovic72

Community Member, 3 Posts

29 November 2013 at 4:16am

This is solved now. For everyone with the same problem:

Add this to the controller:

private static $allowed_actions = array (
'rss'
);

And don't forget to do this:
/dev/build?flush=1

Avatar
camfindlay

Forum Moderator, 267 Posts

30 November 2013 at 10:31am

I'm submitting a pull request to update the tutorial docs with this, thanks for the find. [url}https://github.com/silverstripe/silverstripe-framework/pull/2697

If you find other things documentation wise you might like to update please checkout the guide for contributing to the documentation to help improve it for everyone :)

http://doc.silverstripe.org/framework/en/trunk/misc/contributing/documentation