registerForAutoconfiguration(ElementBrowserInterface::class)->addTag('recordlist.elementbrowser'); $containerBuilder->registerForAutoconfiguration(ToolbarItemInterface::class)->addTag('backend.toolbar.item'); $containerBuilder->registerForAutoconfiguration(ProviderInterface::class)->addTag('backend.contextmenu.itemprovider'); $containerBuilder->registerForAutoconfiguration(SearchProviderInterface::class)->addTag('livesearch.provider'); $containerBuilder->registerForAutoconfiguration(NodeInterface::class)->addTag('backend.form.node'); $containerBuilder->registerForAutoconfiguration(LocalizationHandlerInterface::class)->addTag('backend.localization.handler'); $containerBuilder->addCompilerPass(new PublicServicePass('backend.controller')); // Single NodeInterface nodes *may* be stateful, for instance when they have properties that are not // properly reset in render(), or if stateful services are injected. Thus, the second argument is true, // which will trigger a new object creation each time, instead of re-using an already existing one. // Note we *may* be able to get rid of this later (to create fewer objects), but it may need some changes, // plus proper communication that single nodes have to be set "shared: false" manually, in case they are stateful. $containerBuilder->addCompilerPass(new PublicServicePass('backend.form.node', true)); $containerBuilder->addCompilerPass(new PublicServicePass('backend.form.dataprovider')); $containerBuilder->addCompilerPass(new AvatarProviderPass('backend.avatar_provider')); $containerBuilder->addCompilerPass(new SidebarComponentsPass(AsSidebarComponent::TAG_NAME)); $containerBuilder->addCompilerPass(new ModuleAccessGatePass(AsModuleAccessGate::TAG_NAME)); // adds tag backend.controller to services $containerBuilder->registerAttributeForAutoconfiguration( AsController::class, static function (ChildDefinition $definition, AsController $attribute): void { $definition->addTag(AsController::TAG_NAME); } ); // Autoconfigure backend avatar providers $containerBuilder->registerAttributeForAutoconfiguration( AsAvatarProvider::class, static function (ChildDefinition $definition, AsAvatarProvider $attribute): void { $definition->addTag(AsAvatarProvider::TAG_NAME, [ 'identifier' => $attribute->identifier, 'before' => implode(',', $attribute->before), 'after' => implode(',', $attribute->after), ]); }, ); // Autoconfigure backend sidebar components $containerBuilder->registerAttributeForAutoconfiguration( AsSidebarComponent::class, static function (ChildDefinition $definition, AsSidebarComponent $attribute): void { $definition->addTag(AsSidebarComponent::TAG_NAME, [ 'identifier' => $attribute->identifier, 'before' => implode(',', $attribute->before), 'after' => implode(',', $attribute->after), ]); }, ); };