trait ContextAwarePluginAssignmentTrait (View source)

Handles context assignments for context-aware plugins.

Methods

t($string, array $args = [], array $options = [])

Ensures the t() method is available.

contextHandler()

Wraps the context handler.

array
addContextAssignmentElement(ContextAwarePluginInterface $plugin, array $contexts)

Builds a form element for assigning a context to a given slot.

Details

abstract protected t($string, array $args = [], array $options = [])

Ensures the t() method is available.

Parameters

$string
array $args
array $options

See also

StringTranslationTrait

protected ContextHandlerInterface contextHandler()

Wraps the context handler.

protected array addContextAssignmentElement(ContextAwarePluginInterface $plugin, array $contexts)

Builds a form element for assigning a context to a given slot.

Parameters

ContextAwarePluginInterface $plugin

The context-aware plugin.

array $contexts

An array of contexts.

Return Value

array

A form element for assigning context.