Jump to:

1161 Posts in 2632 Topics by 409 members

Upgrading SilverStripe

SilverStripe Forums » Upgrading SilverStripe » allowed actions in extension

Ask questions about upgrading SilverStripe to the latest version.

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

Page: 1
Go to End
Author Topic: 496 Views
  • Matulko
    Avatar
    Community Member
    9 Posts

    allowed actions in extension Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: allowed actions in extension Link to this post

    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.

  • Matulko
    Avatar
    Community Member
    9 Posts

    Re: allowed actions in extension Link to this post

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

    496 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.