Can You Override The Classmap Via The Config?

I’m trying to extend the Gii model generator for some custom logic around what fields to make required, and what defaults to specify, etc.

I’ve tried setting this in my main-local.php config:


   

 $config['modules']['classMap'] = [[

        'yii\gii\generators\model\Generator' => 'common\myTemplates\model\Generator.php'

    ]];



But it doesn’t appear to work. Can i modify the classmap in this way, or do i do it directly via Yii::$classMap ?

Presume no then.

So how do i override a native class? Can i easily take a native class, extend it, and get all dependents to run off my new adjusted class?