Closed antoine1003 closed 3 years ago
I have the same error.
I found the solution, I am working with Symfony 4.2 here:
1 - In services.yaml put: Craue\ConfigBundle\Util\Config: '@craue_config_default' at the same level than _defaults
2 - In the the class where you will use it, something like this: use Craue\ConfigBundle\Util\Config; . . private $setting;
public function __construct(Config $setting) { $this->setting = $setting; }
then in methods...
$this->setting->get('name-of-a-setting');
That's all.
Let me know if #57 helps and makes things clear enough, or if it's even too detailed that way.
With this PR, you can at least remove the entry from your services.yaml
again as the bundle will define this alias.
Hi, I am trying to use this bundle but after following the step for the instalation when I want to retrieve a setting, an error is thrown at this line :
$this->get('craue_config')->get('can_user_participate');
.The full error I get :
I am using Symfony 4.2
Thanks, A.