Setting aliases in Yii2 within the app config file

后端 未结 4 770
孤独总比滥情好
孤独总比滥情好 2020-12-16 05:13

I\'m trying to set an alias in Yii2 but I\'m getting a Invalid Parameter / Invalid path alias for the below code that is placed in the

4条回答
  •  抹茶落季
    2020-12-16 05:28

    @webroot alias is not available at this point, it is defined during application bootstrap :

    https://github.com/yiisoft/yii2/blob/2.0.3/framework/web/Application.php#L60

    No need to define this alias yourself, you should simply use another one :

    'aliases' => [
        // Set the editor language dir
        '@editor_lang_dir' => '@app/web/scripts/sceditor/languages/',
    ],
    

提交回复
热议问题