I'm trying to create simple project on Yii2. Now I'm creating User functionality. I already created User model and CRUD with Gii. When I create new user or edit, model saves password in plain text. I want to override this functionality to have an ability to save password for example in md5 format.
In Zend Framework there was similar ability. I have password field and when I want to change default setting password behavior I just created setPassword method in the model. Which way is correct for Yii2?
In my User.php model class I created setPassword($password) method but it is not executed (I check it putting var_dump inside).