Hello guys,
I am trying to override or completely replace some functionality of the FORM class, according to http://docs.silverstripe.org/en/3.1/developer_guides/extending/injector/ it recently became possible to override classes with your own clasess utilizing injector. However I don't quite get how can I use injector to override FORM class, it simply does not work at all.
I've tried this:
Config::inst()->update('Injector', 'Form', array(
'class' => 'MyForm'
));
and this:
Injector:
Form:
class: MyForm
None of this options work and I have no idea why.
Also I've tried older way:
Object::useCustomClass('Form', 'MyForm', true);
Which will not work and never worked for forms that were created other way than Object::create().
So my question is - is there ANY way I can replace or override a form class?