Yii2 enchacement proposal: Class overload

Sometimes it can be situations when we need to modify logic deep in framework, for example, I needed this while developing advanced Form.

Possible solution: We could have a list with class replacements defined in config. \Yii::createObject method checks if the replacement list is not empty, is there are items then it tries to replace the class.