I have a read a lot of topics on this and I can\'t seem to find a solution to my problem.
I feel like the problem is obvious and maybe I have just been staring at
The problem is the container not being injected into the controller here.
Normally, Symfony does this automatically if you're extending Symfony\Bundle\FrameworkBundle\Controller\Controller, which itself extends Symfony\Component\DependencyInjection\ContainerAware:
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class YourController extends Controller
The container is injected into the controller (if not explicitly defined as a service) using setter injection calling the method setContainer() with the container as an argument.
Now, as you configured your controller as a service you need to add the setContainer call to your service configuration:
services:
database_controller:
class: Fuel\FormBundle\Controller\DatabaseController
calls:
- [setContainer, ["@service_container"]]
Clear your cache afterwards.