Jump to:

23477 Posts in 18941 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Decorating a controller

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

Page: 1
Go to End
Author Topic: 1815 Views
  • ChrisBryer
    Community Member
    95 Posts

    Decorating a controller Link to this post

    what's the best way to decorate a page_controller so that i can add another allowed_action?

    ultimately, i'm building a widget for the blog that needs to use a new action on blogholder (like the tag cloud does), but whenever i decorate page_controller, it says i cant do that because page_controller doesnt extend DataObject. i dont want to hack the blog module for upgrade reasons.

    Any advice would be awesome.


  • DsX
    Community Member
    178 Posts

    Re: Decorating a controller Link to this post

    did you ever figure this out?
    I am trying to make my first module, and want to have site wide methods available via the page_controller but want my code contained in my module..

  • Martijn
    Community Member
    271 Posts

    Re: Decorating a controller Link to this post

    class MySiteWideControllerMethods extends Extension{

    //Page_Controller = $this->owner



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.