- Member | 181
I'm using nette master, is there a way for registering callbacks (particularly in service tag(s) and using generated factory)?
$containerBuilder->addDefinition($this->prefix('myFactory')) ->setImplement('App\IMyFactory') ->addTag('myTag', [ 'callback' => '@' . $this->prefix('myFactory') . '::create', // does not work as generated factory does not inherit from Nette\Object :( ]);
Thanks for advice.
- Nette Core | 907
I'm not sure. But I think it's not possible.
What do you need it for?
I had a component container which should contain list of factory callbacks for nested components. I've solved it by registering interface not general callback. I've been thinking callback would suffice but due to this problem it doesn't.4 years ago