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.

General Questions /

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

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

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


Reply


3 Posts   968 Views

Avatar
Stefanovic72

Community Member, 2 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, 2 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, 149 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[/url]

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 :)

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