In this guide you'll learn how to create a custom service using the Symfony DI Container.
Prerequisites
In order to add your own custom service for your plugin, you first need a plugin as base. Therefore, you can refer to the Plugin Base Guide.
Adding service
Adding a custom service requires to load a services.xml file with your plugin. This is done by placing a file with name services.xml into a directory called src/Resources/config/.