Yii1.0 method of setting constants: first create a new "constants.php"; then define the constants through the method "define('CL', 'https://www.baidu.com/');"; Then introduce the constants into the system; finally, call the system constants anywhere in the system.
yii Set system constants
Recommended: "yii tutorial"
1, create a new constants.php under protected/config/
2, define constants in constants.php define('CL', 'https://www.baidu.com/');/ /Constant name, constant content
3, introduce constants into the system: introduce the system into the entry index.php file, require_once(dirname(__FILE__).'/protected/config/constants.php');
4. Call system constants anywhere in the system:
The above is the detailed content of How to set constants in yii1.0. For more information, please follow other related articles on the PHP Chinese website!