Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
      • Traits
    • Reflection
    • Security
    • Tokenizer
    • Utils
  • Tracy
    • Bridges
      • Nette
  • none

Classes

  • ConstantsExtension
  • DecoratorExtension
  • DIExtension
  • ExtensionsExtension
  • InjectExtension
  • PhpExtension
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
 1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework (https://nette.org)
 5:  * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
 6:  */
 7: 
 8: namespace Nette\DI\Extensions;
 9: 
10: use Nette;
11: 
12: 
13: /**
14:  * Enables registration of other extensions in $config file
15:  */
16: class ExtensionsExtension extends Nette\DI\CompilerExtension
17: {
18:     public function loadConfiguration()
19:     {
20:         foreach ($this->getConfig() as $name => $class) {
21:             if (is_int($name)) {
22:                 $name = null;
23:             }
24:             if ($class instanceof Nette\DI\Statement) {
25:                 $rc = new \ReflectionClass($class->getEntity());
26:                 $this->compiler->addExtension($name, $rc->newInstanceArgs($class->arguments));
27:             } else {
28:                 $this->compiler->addExtension($name, new $class);
29:             }
30:         }
31:     }
32: }
33: 
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0