Slim 3: how to access settings?

夙愿已清 提交于 2019-12-05 02:14:34

You can get settings like this:

$container = $app->getContainer();
$settings = $container->get('settings');

You can access settings route callables via $this

$modulesSettings = $this->get('settings')['modules']['local'];

For more information read here

The address of the SLIM 3 configuration file is pro/src/settings.php, and you can add additional settings; In any route you can access them like this:

var_dump($this->get('settings')['logger']);
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!