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

Popular posts from this blog

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -