Config Manager

The config manager holds all settings for the current environment.

The easiest way to use the Config Manager is to make sure your Controllers extend Tomahawk\Routing\Controller. You then have access to it through $this->config.

Other wise just add the following parameter to the construct method of your Controller Tomahawk\Config\ConfigInterface and it will get injected in through the Service Container.

Using The Config Manager


Getting A Config Value

You can get a config value by doing the following:

You can get a pass a default value in case a value isn't set:

Setting A Config Value

You can get a config value by doing the following:

Checking A Config Value Exists

You can check if a config value exists by doing the following: