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.

Customising the CMS /

Extension Class and overriding a method


Reply


4 Posts   2328 Views

Avatar
Myrdhin

Community Member, 67 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, 528 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, 67 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, 67 Posts

27 February 2010 at 11:36pm

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

I read [url=http://www.silverstripe.org/data-model-questions/show/251824?start=0#post251985]this[/url] in the Forum. I think it's not possible to replace AssetAdmin class...