How does yii customize a global configuration item? You guys, I just started using yii and want to customize a global configuration item, similar. net web. as configured in config, can access: Yii: app ()-& gt; myconfig be defined like this? What should I do? ------ Solution ---------------------- The main configuration file contains a params & nbsp; key. How can I customize a global configuration item for yii?
Ladies and gentlemen, I just started using yii.
I want to customize a global configuration item, similar to the configuration in web. config in. net.
Access: Yii: app ()-> myconfig like this
Can this be defined? What should I do?
------ Solution ----------------------
In the main configuration file
Which has a params key. Just write it in.
Then in the controller
$ This-> params ['Your key']
------ Solution ----------------------
Upstairs positive solution
The recommended practice is at the bottom of/config/main. php. the default value is
'Params' => array (
'Adminmail' => [email protected] ',
),
Change
'Params' => require ('params. php '),
Create a params. php file in/config.
Return array (
'Adminmail' => [email protected] ',
);