Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » common functionality in all controllers

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 865 Views
  • toddm
    Community Member
    15 Posts

    common functionality in all controllers Link to this post

    I'd like to have access to a function from every one of my controllers. Is there a best practice for doing this?

    I'm thinking of extending ContentController, adding the function and then have all my controllers extend this Controller.

    Thoughts? Better ways to do it. I'm new, so I apologize if I missed a previous thread or documentation on where this is addressed.


  • Willr
    Forum Moderator
    5497 Posts

    Re: common functionality in all controllers Link to this post

    If all your custom page extend Page and their Controllers extend Page_Controller then you could just put it in Page_Controller since all the other controllers will inherit it

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.