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.

Customising the CMS /

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

Using add_extension() to extend Controller functionality


Go to End


2271 Views

Avatar
jhirm

Community Member, 21 Posts

27 April 2009 at 11:21pm

I want to extend the functionality of a Controller using Object::add_extension(), and am not quite sure how to go about it. I'd like to override the PageController's init() function to add some security logic, but I'm not able to use methods defined in PageController in my extension because it inherits from Extension instead of PageController...

Any ideas? Or can someone point me to some documentation that might be useful?

Thanks.