Plugin
This section will go over how to use the PreferencesModulePlugin that ships with the Preferences module.
preference
The preference function returns an instance of the preference as a presenter.
The presenter returned depends on the field type used for the preference.
Returns: \Anomaly\Streams\Platform\Entry\EntryPresenter or null
Arguments
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
|
$key |
true |
string |
none |
The key of the preference you want to get. |
Twig
{{ preference('streams::timezone').value() }}
preference_value
The preference_value function returns the raw value of the preference.
Returns: mixed
Arguments
| Key | Required | Type | Default | Description |
|---|---|---|---|---|
|
$key |
true |
string |
none |
The key of the setting to get. |
Twig
{{ preference_value('streams::timezone') }}