diff --git a/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md b/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md index e0ad2520b..0e4b1e3db 100644 --- a/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md +++ b/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md @@ -60,6 +60,21 @@ Or through the `config()` object on the class. $config = $this->config()->get('property')'; ``` +If your class does not inherit from a SilverStripe class, you must apply the [Configurable](api:SilverStripe\Core\Config\Configurable) trait in order to access the `config()` object. + +**mysite/code/MyOtherClass.php** + +```php +use SilverStripe\Core\Config\Configurable; + +class MyOtherClass +{ + use Configurable; + +} +``` + + Note that by default `Config::inst()` returns only an immutable version of config. Use `Config::modify()` if it's necessary to alter class config. This is generally undesirable in most applications, as modification of the config can immediately have performance implications, so this should be used sparingly, or