[symfony-users] SF2: How inject container as service into model

2010-09-24 Thread Ladislav Prskavec
I have simple controller: class HelloController extends Controller { public function indexAction($name) { $owner = $this['cd']->getOwner(); return $this->render('HelloBundle:Hello:index', array('name' => $owner)); } } model: namespace Application\HelloBundle\Models

Re: [symfony-users] SF2: How inject container as service into model

2010-09-24 Thread Alan Bem
I would create a factory but IMHO it is bad design decision to couple domain models with container. 2010/9/24 Ladislav Prskavec > I have simple controller: > > class HelloController extends Controller > { >public function indexAction($name) >{ >$owner = $this['cd']->getOwner(