Plugin

This section will go over how to use the SettingsModulePlugin that ships with the Settings module.

setting

The setting function returns an instance of the setting as a presenter.

The presenter returned depends on the field type used for the setting.

Returns: \Anomaly\Streams\Platform\Entry\EntryPresenter or null
Arguments
Key Required Type Default Description
$key true string none The key of the setting you want to get.
Twig
{{ setting('streams::name') }} // Returns __toString from setting field type presenter

<ul>
    {% for locale, name in setting('streams::enabled_locales').selections() %}
    <li>
        {{ name }} [{{ locale }}]
    </li>
    {% endfor %}
</ul>

setting_value

The setting_value function returns the raw value of the setting.

Returns: mixed
Arguments
Key Required Type Default Description
$key true string none The key of the setting to get.
Example
{{ setting_value('streams::name') }}

{{ setting_value('streams::default_locale') }}

<ul>
    {% for locale in setting_value('streams::enabled_locales') %}
    <li>
        {{ locale }}
    </li>
    {% endfor %}
</ul>