yii2 Advanced multi-version support

1, in the common / config / bootstrap.php, this alias, pointing to the corresponding folder, for example:

Yii::setAlias('@test/v1', dirname(dirname(__DIR__)) . '/test/v1');

  Yii::setAlias('@test/v2', dirname(dirname(__DIR__)) . '/test/v2'); 

       In order to better demonstrate the path, add the "/";

2, corresponding to modify the name the control file, for example:

      namespace  test\v1\assets;

     Corresponding to the above alias

3, the corresponding modified sub in config / main.php

    'controllerNamespace' => ' test\v1\controllers',

  Pointing to the appropriate controllers

Published 27 original articles · won praise 53 · views 160 000 +

Guess you like

Origin blog.csdn.net/auspi12341/article/details/52474612