How to register callback in service tag?
Notice: This thread is very old.
- JuniorJR
- 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.