I want to put the appid of the public account in a configuration file with a custom parameter, and then it can be retrieved from any controller. if it is modified, it will be changed to the called place. I want to put the appid of the public account in a configuration file with a custom parameter, and then it can be retrieved from any controller. if it is modified, it will be changed to the called place.
Reply content:
I want to put the appid of the public account in a configuration file with a custom parameter, and then it can be retrieved from any controller. if it is modified, it will be changed to the called place.
Config/param. php
Yii: $ app-> params ['key'] key is your parameter key name
First, put the parameters in the params. php file under the config directory, as follows:
Return ['key' => 'value',];
Then, when referencing, use:
\ Yii: $ app-> params ['key']
Note that it is params, not param.