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

Extension Class and overriding a method


Go to End


4 Posts   4300 Views

Avatar
Myrdhin

Community Member, 70 Posts

27 February 2010 at 9:05am

Hello,

I would like to know if it's possible to override a method with an Extension Class ?

I would like to change the return value of a method. This method is a cms class (AssetAdmin::getTreeAsUL() exactly).
Thanks,

Avatar
zenmonkey

Community Member, 545 Posts

27 February 2010 at 10:07am

This may help

http://www.ssbits.com/custom-login-form-with-group-based-redirection/

It overrides the standard login procedure. It should at least give you start

Avatar
Myrdhin

Community Member, 70 Posts

27 February 2010 at 10:55pm

Thanks.

He use object::useCustomClass() method in this tutorial to completely replace the original class. I would like to experiment another way before this solution... But i think we can't do it (overriding a method in a core class) without useCustomClass...

Avatar
Myrdhin

Community Member, 70 Posts

27 February 2010 at 11:36pm

i try the useCustomClass() solution but it doesn't work...

I read this in the Forum. I think it's not possible to replace AssetAdmin class...