*/ class LoadSidebarScripts implements IEventListener { public function __construct( private readonly IRequest $request, ) { } public function handle(Event $event): void { if (!($event instanceof LoadSidebar)) { return; } // Only load sidebar tab in the photos app. if (!preg_match('/^photos\.page\..+/', (string)$this->request->getParams()['_route'])) { return; } Util::addScript(Application::APP_ID, 'photos-sidebar'); Util::addStyle(Application::APP_ID, 'photos-sidebar'); } }