Home > Backend Development > PHP Tutorial > PHP框架Yii2通过内置的方法怎么把配置信息写入到配置文件

PHP框架Yii2通过内置的方法怎么把配置信息写入到配置文件

WBOY
Release: 2016-06-06 20:36:19
Original
1081 people have browsed it

​比如我再后台配置了邮件信息,我想法邮件信息更新到common\main-local.php里面 代码应该怎么写?

回复内容:

​比如我再后台配置了邮件信息,我想法邮件信息更新到common\main-local.php里面 代码应该怎么写?

common\main-local.php中的邮件配置从另一个文件中引入,后台控制器先将数据保存到数据库中,然后再生成引入的这个文件。后台控制器中生成文件的方法可以直接用原生方法。

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template