Yii2 params access within local config file in common directory

前端 未结 3 1724
感情败类
感情败类 2020-12-19 04:27

I\'m using Yii2 advanced template, I want to access params.php in main-local.php file, I called this ways:

main-local.

3条回答
  •  天涯浪人
    2020-12-19 05:23

    You can just do

    $params['mandrill_api_key'] 
    

    you dont need to use

    \Yii::$app->params['mandrill_api_key']
    

提交回复
热议问题