How to override Core class in 8+ ?
Permalink
I trying to override core User class, but I'm not sure I'm doing this right way.
So, what was done:
1) Copied concrete/src/User/User.php to /application/src/User/User.php
2) Namespace in this file is changed to Application\Src\User;
3) Added alias to /application/config/app.php
'aliases' => array(
'User' => '\Application\Src\User\User',
),
But I'm getting an error Class '\Application\Src\User\User' not found
What am I doing wrong?
Thanks, Nick.
So, what was done:
1) Copied concrete/src/User/User.php to /application/src/User/User.php
2) Namespace in this file is changed to Application\Src\User;
3) Added alias to /application/config/app.php
'aliases' => array(
'User' => '\Application\Src\User\User',
),
But I'm getting an error Class '\Application\Src\User\User' not found
What am I doing wrong?
Thanks, Nick.
You may need to use application/src/concrete rather than application/src. I had a similar issue with overriding a core service, and this post pointed me in the right direction:
https://stackoverflow.com/questions/41521943/class-not-found-error-w...