Craft Themes (3.x)

ViewModeService extends Service
in package

Table of Contents

CONFIG_KEY  = 'themes.viewModes'
DEFAULT_HANDLE  = 'default'
EVENT_AFTER_DELETE  = 'after_delete'
EVENT_AFTER_SAVE  = 'after_save'
EVENT_BEFORE_APPLY_DELETE  = 'before_apply_delete'
EVENT_BEFORE_DELETE  = 'before_delete'
EVENT_BEFORE_SAVE  = 'before_save'
VIEWMODE_CACHE_TAG  = 'themes::viewMode'
$_viewModes  : Collection
$cacheTags  : array<string|int, string>
cleanUp()  : mixed
Clean up for layout, deletes old view modes
create()  : ViewModeInterface
Creates a view mode from config
delete()  : bool
Deletes a view mode
get()  : ViewModeInterface|null
Get a view mode
getAll()  : Collection
Get all view modes
getById()  : ViewModeInterface
Get view mode by id
getByUid()  : ViewModeInterface
Get view mode by uid
getDefault()  : ViewModeInterface|null
Get a default view mode
getForLayout()  : array<string|int, mixed>
Get all view modes for a layout
getRecordByUid()  : ViewModeRecord
Get view mode record by uid, or a new one if it's not found
handleChanged()  : mixed
Handles a change in view mode config
handleDeleted()  : mixed
Handles a deletion in view mode config
populateFromData()  : ViewModeInterface
Populates a view mode from an array of data
rebuildConfig()  : mixed
Respond to rebuild config event
save()  : bool
Save a view mode
add()  : mixed
Add a view mode to internal cache
blockCacheService()  : BlockCacheService
Get the block cache service
blockProviderService()  : BlockProvidersService
Get the block providers service
blocksService()  : BlockService
Get the blocks service
collectCacheTag()  : mixed
Collect a tag for a view mode
displayService()  : DisplayService
Get the display service
eagerLoadingService()  : EagerLoadingService
Get the eager loading service
fieldDisplayersService()  : FieldDisplayerService
Get the field displayers service
fieldsService()  : FieldsService
Get the fields service
fileDisplayerService()  : FileDisplayerService
Get the file displayers service
groupsService()  : GroupsService
Get the groups service
layoutService()  : LayoutService
Get the layout service
matrixService()  : MatrixService
Get the matrix service
themesRegistry()  : ThemesRegistry
Get the themes registry
triggerEvent()  : mixed
Triggers an event
viewModesService()  : ViewModeService
Get the view mode service
viewService()  : ViewService
Get the view service

Constants

EVENT_BEFORE_APPLY_DELETE

public mixed EVENT_BEFORE_APPLY_DELETE = 'before_apply_delete'

EVENT_BEFORE_DELETE

public mixed EVENT_BEFORE_DELETE = 'before_delete'

VIEWMODE_CACHE_TAG

public mixed VIEWMODE_CACHE_TAG = 'themes::viewMode'

Properties

Methods

cleanUp()

Clean up for layout, deletes old view modes

public cleanUp(array<string|int, mixed> $viewModes, LayoutInterface $layout) : mixed
Parameters
$viewModes : array<string|int, mixed>
$layout : LayoutInterface
Return values
mixed

getAll()

Get all view modes

public getAll() : Collection
Return values
Collection

handleChanged()

Handles a change in view mode config

public handleChanged(ConfigEvent $event) : mixed
Parameters
$event : ConfigEvent
Return values
mixed

handleDeleted()

Handles a deletion in view mode config

public handleDeleted(ConfigEvent $event) : mixed
Parameters
$event : ConfigEvent
Return values
mixed

rebuildConfig()

Respond to rebuild config event

public rebuildConfig(RebuildConfigEvent $e) : mixed
Parameters
$e : RebuildConfigEvent
Return values
mixed

matrixService()

Get the matrix service

protected matrixService() : MatrixService
Return values
MatrixService

triggerEvent()

Triggers an event

protected triggerEvent(string $type, Event $event) : mixed
Parameters
$type : string
$event : Event
Return values
mixed

Search results