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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

allowed actions in extension


Go to End


3 Posts   4270 Views

Avatar
Matulko

Community Member, 9 Posts

3 January 2014 at 4:37am

hello everybody
i have little problem with this code

class PageControllerExtension extends Extension 
{
	private static $allowed_actions = array(
		'loadNextPage',
	);

	public function loadNextPage()
	{
		$pl = $this->owner->PaginatedList();
	

...

when i call url with this method "something/loadNextPage" it doesnt work
is still possible call actions defined in extensions?
thanks

Avatar
Willr

Forum Moderator, 5523 Posts

3 January 2014 at 6:28pm

I haven't tested this myself but last time I did it didn't work so I created my own controller / route and used that instead. But that was back in 2.4. Make sure you've done a ?flush=1 and that the extension is added to the controller. Looking at the implementation of it (RequestHandler::allowedActions) it should work.

Avatar
Matulko

Community Member, 9 Posts

3 January 2014 at 10:48pm

Thanks Willr, I was pretty sure I flushed this page becouse other methods work but obviously not...
after flush works perfect