trait LayoutBuilderContextTrait (View source)

Provides a wrapper around getting contexts from a section storage object.

Properties

protected ContextRepositoryInterface $contextRepository

The context repository.

Methods

contextRepository()

Gets the context repository service.

getAvailableContexts(SectionStorageInterface $section_storage)

Provides all available contexts, both global and section_storage-specific.

Details

protected ContextRepositoryInterface contextRepository()

Gets the context repository service.

Return Value

ContextRepositoryInterface

The context repository service.

protected ContextInterface[] getAvailableContexts(SectionStorageInterface $section_storage)

Provides all available contexts, both global and section_storage-specific.

Parameters

SectionStorageInterface $section_storage

The section storage.

Return Value

ContextInterface[]

The array of context objects.