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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

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

Extension Class and overriding a method


Go to End


4 Posts   3791 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...