[SOLVED] Website Settings Service


I got a question about the Website Settings Service located under \Pimcore\Config\Config.

What is the service name for it? I am trying to inject it into one of my service but i need the service definition as a argument.

I know i could use the autowiring feature from Symfony, but it would still be nice to know :wink:

Best regards



Ok apparently it cannot be autowired:

Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\RuntimeException: Cannot autowire service "myservice": argument "$config" of method "MyService::__construct()" references class "Pimcore\Config\Config" but no such service exists.

The question is now, how can i access website settings inside of a service?


Try to use \Pimcore\Config::getWebsiteConfig() :slight_smile:



Hey scrummer,

thank you, just found that method some minutes ago when looking at the core code :wink:


see also https://pimcore.com/docs/5.x/Development_Documentation/Tools_and_Features/Website_Settings.html