Symfony Call to a member function get() on null -
i use symfony components in own framework. installed di component , tried in basecontroller time same error:
call member function get() on null
my base controller:
abstract class basecontroller implements containerawareinterface { use containerawaretrait; ... }
and when try access $this->container->get('ser_id');
return call member function.
how slove this?
update:
only work if include in controller service container
$this->service_container = include __dir__ .'/../../../container.php';
and use this:
$this->service_container->get('id');
Comments
Post a Comment