1

I'm developing an add on for Expression Engine 3, and I can't figure out what the format should be for the config file that will be used from the Config Service. The Expression Engine documentation says that the config file should be in ./config/ relative to the add on directory, but it has no information on what the format should be.

The docs say that the configuration would be accessed with:

ee('Config')->get('my_addon:my_config.my_item');

1 Answer 1

1

It works just like the main user/config/config.php file.

So in user/addons/my_addon/config/config.php:

<?php
    $config = array(
        'foo' => 'bar',
        'baz' => 'foo'
    );
?>

Then access your config items like so:

$foo = ee('Config')->get('my_addon:foo');
// returns 'bar'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.