Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TexyContainer extends Nette\DI\Container
- {
- protected function createServiceTexy()
- {
- $texy = new Texy()
- // konfigurace
- return $texy;
- }
- protected function createServiceTexylaFactory()
- {
- $container = $this;
- return callback(function () use ($container) {
- $texyla = new Texyla();
- // konfigurace
- return $texyla;
- });
- }
- }
- // přidáš do configu
- // v presenteru
- $texyla = $this->context->texy->texylaFactory->invoke();
Advertisement
Add Comment
Please, Sign In to add comment