HosipLan

Untitled

Sep 18th, 2011
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. class TexyContainer extends Nette\DI\Container
  2. {
  3.  
  4.     protected function createServiceTexy()
  5.     {
  6.         $texy = new Texy()
  7.         // konfigurace
  8.  
  9.         return $texy;
  10.     }
  11.  
  12.  
  13.     protected function createServiceTexylaFactory()
  14.     {
  15.         $container = $this;
  16.         return callback(function () use ($container) {
  17.             $texyla = new Texyla();
  18.             // konfigurace
  19.  
  20.             return $texyla;
  21.         });
  22.     }
  23.  
  24. }
  25.  
  26. // přidáš do configu
  27.  
  28. // v presenteru
  29.  
  30. $texyla = $this->context->texy->texylaFactory->invoke();
Advertisement
Add Comment
Please, Sign In to add comment