Addon

The addon functions provide access to the \Anomaly\Streams\Platform\Addon\AddonCollection.

addon

The addon function returns a decorated addon instance.

Returns: \Anomaly\Streams\Platform\Addon\AddonPresenter
Arguments
Key Required Type Default Description

$identifier

true

string

none

The slug or dot namespace of the addon.

Twig
// Specify as a dot namespace.
{{ addon('anomaly.module.users').name }} // Users Module

// Or you can pass the
// slug if it's unique.
{{ addon('pages').name }} // Users Module

addons

The addons method returns a decorated collection of addons.

Returns: \Anomaly\Streams\Platform\Addon\AddonCollection
Arguments
Key Required Type Default Description

type

false

string

null

The type of addons to return.

Twig
{{ addons() }} // A collection of all addons.

// A collection of all modules.
{% for module in addons('modules') %}
    <p>{{ module.name }} is enabled.</p>
{% endfor %}