class Settings implements ExtenderInterface

Methods

serializeToForum(string $attributeName, string $key, callable|string|null $callback = null)

Serialize a setting value to the ForumSerializer attributes.

default(string $key, mixed $value)

Set a default value for a setting.

resetWhen(string $key, callable|string $callback)

Delete a custom setting value when the callback returns true.

registerLessConfigVar(string $configName, string $key, callable|string|null $callback = null)

Register a setting as a LESS configuration variable.

resetJsCacheFor(string $setting)

Register a setting that should trigger JS cache clear when saved.

void
extend(Container $container, Extension|null $extension = null)

No description

Details

Settings serializeToForum(string $attributeName, string $key, callable|string|null $callback = null)

Serialize a setting value to the ForumSerializer attributes.

Parameters

string $attributeName
string $key
callable|string|null $callback

Return Value

Settings

Settings default(string $key, mixed $value)

Set a default value for a setting.

Replaces inserting the default value with a migration.

Parameters

string $key
mixed $value

Return Value

Settings

Settings resetWhen(string $key, callable|string $callback)

Delete a custom setting value when the callback returns true.

This allows the setting to be reset to its default value.

Parameters

string $key
callable|string $callback

Return Value

Settings

Settings registerLessConfigVar(string $configName, string $key, callable|string|null $callback = null)

Register a setting as a LESS configuration variable.

Parameters

string $configName
string $key
callable|string|null $callback

Return Value

Settings

Settings resetJsCacheFor(string $setting)

Register a setting that should trigger JS cache clear when saved.

Parameters

string $setting

Return Value

Settings

void extend(Container $container, Extension|null $extension = null)

Parameters

Container $container
Extension|null $extension

Return Value

void