I want to override 'loginForm' method in 'LoginHandler' class. I am trying to use the code given below for that. But it is not working.
LoginHandlerExtension.php
<?php
use SilverStripe\Core\Extension;
class LoginHandlerExtension extends Extension {
public function loginForm() {
return 'xxxxxx';
}
}
app.yml
SilverStripe\Security\MemberAuthenticator\LoginHandler:
extensions:
- LoginHandlerExtension
What would you want to override on the loginForm method? If you want it to use a different Form class (e.g.
MyMemberLoginForm
), you can tell Injector to use your custom class in YML like this:as the LoginForm method does nothing else but return the form.