Home> PHP Framework> YII> body text

How to set constants in yii1.0

藏色散人
Release: 2020-07-20 10:59:50
Original
2571 people have browsed it

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.

How to set constants in yii1.0

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!