This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
I really want to override the functionality of the OnSiginin function called in data-request="onSiginin" on the Login Forms. Where to do that ? and How to call the new function on the data-request ?
You could do it via the page code like this
[account]
==
// This function takes priority over the components
function onSignin()
{
// Do custom logic here
return $this->account->onSignin();
}
==
...
Last updated
as daftspunk said you can just define onSignin function in your Layout and it will be overrided.
When I try to do this
$code = implode('!', [$user->id, $user->getResetPasswordCode()]);
$link = $this->controller->currentPageUrl([
$this->property('paramCode') => $code
]);
in '// Do custom logic here' below
[account]
==
// This function takes priority over the components
function onSignin()
{
// Do custom logic here
return $this->account->onSignin();
}
==
...
I get an error
"call_user_func_array() expects parameter 1 to be a valid callback, class 'Cms\Classes\Controller' does not have a method 'property'" on line 112 of /home/vagrant/Code/octobercms/modules/cms/Classes/CodeBase.php
It looks like property()
method isn't available in this new overriding function.
Why is that?
Because I'm trying to get properties of the account component in the overriding function, this is how the correct logic should look like.
$this->account->property('paramCode') => $code
1-8 of 8