Blogger Information
Blog 1
fans 0
comment 0
visits 810
Related recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
配置的获取与设置
小兔几
Original
810 people have browsed it

获取全部配置项
dump(Config::get());
仅获取app下面的配置项,app是一级配置项
dump(Config::get(‘app.’));
仅获取一级配置项,推荐使用pull()
dump(Config::pull(‘app’));
获取二级配置项
dump(Config::get(‘app.app_debug’));
app是默认的一级前缀,所以可以省略
dump(Config::get(‘app_debug’));
动态设置,静态设置是直接修改配置文件
dump(Config::get(‘app_debug’));
Config::set(‘app_debug’,true);
dump(Config::get(‘app_debug’));

## 使用助手函数config来进行配置函数的获取设置和查询:使用助手函数config来进行配置函数的获取设置和查询:

助手函数不依赖于config类
dump(Config());//不传入参数就是获取全部的配置项
dump(Config(‘default_module’));
查询是否存在某配置项
dump(Config(‘?database.username’));
dump(Config(‘database.username’));
设置配置项的值
Config(‘database.username’,’localhost’);
dump(Config(‘database.username’));

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post