HosipLan

Untitled

Aug 11th, 2014
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. class InjectExtension extends \Nette\DI\CompilerExtension {
  2.     public function beforeCompile(Nette\PhpGenerator\ClassType $class) {
  3.         $builder = $this->getContainerBuilder();
  4.         foreach ($builder->getDefinitions() as $name => $service) {
  5.             if (stripos($name, 'kdyby.') === 0) { continue; } // https://www.youtube.com/watch?v=otCpCn0l4Wo
  6.             $service->setInject(TRUE);
  7.         }
  8.     }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment