Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的应用程序启动后,在某些情况下,我想将一些数据批量加载到控制器内的配置单元中。
是否有一种简单的方法可以将 .ini 文件导入不是 config.ini 或 routes.ini 文件的配置单元?
是的:
$f3->config('abc/def.ini'); echo $f3->get('foo');//bar echo $f3->get('arr.key');//123
abc/def.ini:
foo=bar arr.key=123
注意:该方法的名称config()可能会产生误导,但它可以解析 ini 文件。
config()