kalamu/dynamique-config-bundle

一个独立的Symfony配置容器。

1.0.0 2019-06-18 11:41 UTC

This package is auto-updated.

Last update: 2024-09-14 02:43:12 UTC


README

此包提供了一种定义一些不依赖于symfony容器配置参数的方法。由于它们是独立的,因此可以在不干扰symfony配置和不清除缓存的情况下更改这些参数。

此包使用一个参数容器,该容器持久保存在文件 app/config/dynamique_config.yml

用法

$config = $container->get('kalamu_dynamique_config');
echo "The background color is : ".$config->get('background_color', 'red'); // get the value of 'background_color' or 'red' if it's not defined
$config->set('background_color', 'blue'); // change the configuration
$config->has('background_color'); // return TRUE
$config->remove('background_color'); // remove this parameter