Overview

Namespaces

  • Budovy
  • Kdyby
    • BootstrapFormRenderer
      • DI
      • Latte
  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Diagnostics
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
      • Diagnostics
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • PhpGenerator
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
  • NetteModule
  • Nextras
    • Datagrid
  • None
  • PHP
  • Tester
    • CodeCoverage
    • Runner
      • Output
  • Vodacek
    • Forms
      • Controls
  • WebLoader
    • Filter
    • Nette

Classes

  • Compiler
  • CompilerExtension
  • Container
  • ContainerBuilder
  • Helpers
  • ServiceDefinition
  • Statement

Exceptions

  • MissingServiceException
  • ServiceCreationException
  • Overview
  • Namespace
  • Class
  • Tree

Class ContainerBuilder

Basic container builder.

Nette\Object
Extended by Nette\DI\ContainerBuilder
Namespace: Nette\DI
Author: David Grudl
Located at vendor/nette/nette/Nette/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
string
$definition

Returns

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

Removes the specified service definition.

Removes the specified service definition.

Parameters

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

Gets the service definition.

Gets the service definition.

Parameters

$name
string

Returns

Nette\DI\ServiceDefinition
public array
# getDefinitions( )

Gets all service definitions.

Gets all service definitions.

Returns

array
public boolean
# hasDefinition( string $name )

Does the service definition exist?

Does the service definition exist?

Parameters

$name
string

Returns

boolean
public string
# getByType( string $class )

Resolves service name by type.

Resolves service name by type.

Parameters

$class
string
class or interface

Returns

string
service name or NULL

Throws

Nette\DI\ServiceCreationException
public array
# findByTag( string $tag )

Gets the service objects of the specified tag.

Gets the service objects of the specified tag.

Parameters

$tag
string

Returns

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

Creates a list of arguments using autowiring.

Creates a list of arguments using autowiring.

Returns

array
public array
# prepareClassList( )

Generates $dependencies, $classes and normalizes class names.

Generates $dependencies, $classes and normalizes class names.

Returns

array
public Nette\DI\ContainerBuilder
# addDependency( mixed $file )

Adds a file to the list of dependencies.

Adds a file to the list of dependencies.

Returns

Nette\DI\ContainerBuilder
public array
# getDependencies( )

Returns the list of dependent files.

Returns the list of dependent files.

Returns

array
public Nette\PhpGenerator\ClassType[]
# generateClasses( mixed $className = 'Container', mixed $parentName = 'Nette\DI\Container' )

Generates PHP classes. First class is the container.

Generates PHP classes. First class is the container.

Returns

Nette\PhpGenerator\ClassType[]
public string
# formatPhp( mixed $statement, mixed $args )

Formats PHP statement.

Formats PHP statement.

Returns

string
public mixed
# expand( mixed $value )

Expands %placeholders% in strings.

Expands %placeholders% in strings.

Returns

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

Returns

Nette\PhpGenerator\PhpLiteral
public string
# getServiceName( mixed $arg )

Converts @service or @\Class -> service name and checks its existence.

Converts @service or @\Class -> service name and checks its existence.

Returns

string
of FALSE, if argument is not service name
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 mixed $currentService
#
Magic properties summary
public read-only array $dependencies
#
Magic properties inherited from Nette\Object
$reflection
API documentation generated by ApiGen 2.8.0