How do I inject services in a class that implements an interface.service?
class RoleNegotiator implements ThemeNegotiatorInterface {
public static function create(ContainerInterface $interface) {
return new static(
$interface->get('router.admin_context')
);
}
public function __construct(RouteMatchInterface $route) {
$this->route = $route;
}
}
The aboveI am using the following code, but it throws an error.
class RoleNegotiator implements ThemeNegotiatorInterface {
public static function create(ContainerInterface $interface) {
return new static(
$interface->get('router.admin_context')
);
}
public function __construct(RouteMatchInterface $route) {
$this->route = $route;
}
}