# How can I access a service inside the theme config function

**URL:** <https://forum.shopware.com/t/how-can-i-access-a-service-inside-the-theme-config-function/57645>\
**Category:** International (English Only)\
**Tags:** programming\
**Created:** [23. Januar 2019 um 16:33 UTC](https://forum.shopware.com/t/how-can-i-access-a-service-inside-the-theme-config-function/57645 "2019-01-23T16:33:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RowanMD](https://avatars.discourse-cdn.com/v4/letter/r/e47c2d/32.png) [@RowanMD](https://forum.shopware.com/u/RowanMD)\
**Post date:** [23. Januar 2019 um 16:33 UTC](https://forum.shopware.com/t/how-can-i-access-a-service-inside-the-theme-config-function/57645/1 "2019-01-23T16:33:34Z")

</div>

I would like to access the dbal\_connection service, in the createConfig function in my Theme.  
„$this-\>container“&nbsp;is not available, which I’d use in&nbsp;a Plugin.

&nbsp;

---

<div class="post-metadata">

**Author:** ![RowanMD](https://avatars.discourse-cdn.com/v4/letter/r/e47c2d/32.png) [@RowanMD](https://forum.shopware.com/u/RowanMD)\
**Post date:** [24. Januar 2019 um 13:04 UTC](https://forum.shopware.com/t/how-can-i-access-a-service-inside-the-theme-config-function/57645/2 "2019-01-24T13:04:45Z")

</div>

Shopware()-\>Container()-\>get(‘dbal\_connection’)
