Answer the question
In order to leave comments, you need to log in
How to override a class in Laravel?
Hi guys!
Actually the question is
: If I need to change a class in yii, I create it in frontend/components/MyClassName; my class and change the kernel class
namespace frontend\components;
use yii\somefolder\ClassName;
class MyClassName extends ClassName
{
//делаю что хочу и как хочу
}
Answer the question
In order to leave comments, you need to log in
you don't have to. Open close principle. Everything can be solved without "redefinitions", it's just such nonsense in yii.
To do this, you just need to replace the implementation in the container following the interface of the component. DI, Carl =)
Here is an example of how to spoof PasswordBroker stackoverflow.com/questions/34409236/how-to-send-t...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question