By amateescu on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
11.3.x
Introduced in version:
11.3.0
Issue links:
Description:
A new WorkspaceSwitchEvent event has been added, which provides the ability to react when the active workspaces changes, either on switching from Live to a workspace or the other way around.
Code example
class WorkspaceSwitchSubscriber implements EventSubscriberInterface {
public function onWorkspaceSwitch(WorkspaceSwitchEvent $event): void {
// Clear a custom static cache entry.
}
public static function getSubscribedEvents(): array {
$events[WorkspaceSwitchEvent::class][] = 'onWorkspaceSwitch';
return $events;
}
}
Impacts:
Module developers