In Fat Free Framework how i can parse an arbitrary ini file and add it to the hive?

StackOverflow https://stackoverflow.com/questions/23538223

  •  17-07-2023
  •  | 
  •  

سؤال

After my application has started up, in certain circumstances I want to bulk load some data into the hive inside a controller.

Is there an easy way for me to import a .ini file into the hive that is not a config.ini or routes.ini file?

هل كانت مفيدة؟

المحلول

Yes:

$f3->config('abc/def.ini');
echo $f3->get('foo');//bar
echo $f3->get('arr.key');//123

abc/def.ini:

foo=bar
arr.key=123

NB: the method's name config() might be misleading but it's there to parse ini files.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top