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
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Utils
  • none
  • Tracy
    • Bridges
      • Nette

Classes

  • Compiler
  • CompilerExtension
  • Container
  • ContainerBuilder
  • ContainerFactory
  • ContainerLoader
  • ServiceDefinition
  • Statement

Exceptions

  • MissingServiceException
  • ServiceCreationException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class ContainerBuilder

Basic container builder.

Nette\Object
Extended by Nette\DI\ContainerBuilder
Namespace: Nette\DI
Located at DI/ContainerBuilder.php
Methods summary
public Nette\DI\ServiceDefinition
# addDefinition( string $name, Nette\DI\ServiceDefinition $definition = NULL )

Adds new service definition.

Adds new service definition.

Parameters

$name
$definition

Returns

Nette\DI\ServiceDefinition
ServiceDefinition
public
# removeDefinition( string $name )

Removes the specified service definition.

Removes the specified service definition.

Parameters

$name
public Nette\DI\ServiceDefinition
# getDefinition( string $name )

Gets the service definition.

Gets the service definition.

Parameters

$name

Returns

Nette\DI\ServiceDefinition
ServiceDefinition
public Nette\DI\ServiceDefinition[]
# getDefinitions( )

Gets all service definitions.

Gets all service definitions.

Returns

Nette\DI\ServiceDefinition[]
ServiceDefinition[]
public boolean
# hasDefinition( string $name )

Does the service definition or alias exist?

Does the service definition or alias exist?

Parameters

$name

Returns

boolean
bool
public
# addAlias( string $alias, string $service )

Parameters

$alias
$service
public
# removeAlias( $alias )

Removes the specified alias.

Removes the specified alias.

public array
# getAliases( )

Gets all service aliases.

Gets all service aliases.

Returns

array
array
public Nette\DI\ContainerBuilder
# setClassName( $name )

Returns

Nette\DI\ContainerBuilder
static
public string
# getClassName( )

Returns

string
string
public string|null
# getByType( string $class )

Resolves service name by type.

Resolves service name by type.

Parameters

$class
or interface

Returns

string|null
service name or NULL

Throws

Nette\DI\ServiceCreationException
ServiceCreationException
public Nette\DI\ServiceDefinition[]
# findByType( string $class )

Gets the service names and definitions of the specified type.

Gets the service names and definitions of the specified type.

Parameters

$class

Returns

Nette\DI\ServiceDefinition[]
ServiceDefinition[]
public array
# findByTag( string $tag )

Gets the service objects of the specified tag.

Gets the service objects of the specified tag.

Parameters

$tag

Returns

array
of [service name => tag attributes]
public array
# autowireArguments( $class, $method, array $arguments )

Creates a list of arguments using autowiring.

Creates a list of arguments using autowiring.

Returns

array
array
public Nette\DI\ContainerBuilder
# addExcludedClasses( array $classes )

Parameters

$classes

Returns

Nette\DI\ContainerBuilder
static
public array
# getDependencies( )

Returns the list of dependent files.

Returns the list of dependent files.

Returns

array
array
public Nette\PhpGenerator\ClassType[]
# generateClasses( $className = NULL, $parentName = NULL )

Generates PHP classes. First class is the container.

Generates PHP classes. First class is the container.

Returns

Nette\PhpGenerator\ClassType[]
Nette\PhpGenerator\ClassType[]
public mixed
# expand( $value )

Expands %placeholders% in strings.

Expands %placeholders% in strings.

Deprecated

Returns

mixed
mixed
public static Nette\PhpGenerator\PhpLiteral
# literal( $phpCode )

Returns

Nette\PhpGenerator\PhpLiteral
Nette\PhpGenerator\PhpLiteral
Methods inherited from Nette\Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants summary
string THIS_SERVICE
#'self'
string THIS_CONTAINER
#'container'
Properties summary
public array $parameters
#array()
public $currentService
#
Magic properties inherited from Nette\Object
$reflection
Nette 2.3-20161221 API API documentation generated by ApiGen 2.8.0