Class Container
The dependency injection container default implementation.
-
Nette\Object
-
Nette\FreezableObject
implements
Nette\IFreezable
-
Nette\DI\Container
implements
Nette\DI\IContainer
Methods summary
public
Nette\DI\Container |Nette\DI\ServiceBuilder
|
#
addService( string $name, mixed $service, mixed $tags = NULL )
Adds the specified service or service factory to the container.
Adds the specified service or service factory to the container.
Parameters
- $name
string
- $service
mixed object, class name or callback
- $tags
mixed array of tags or string typeHint
Returns
Implementation of
|
public
|
#
removeService( string $name )
Removes the specified service type from the container.
Removes the specified service type from the container.
Parameters
Implementation of
|
public
object
|
#
getService( string $name )
Gets the service object by name.
Gets the service object by name.
Parameters
Returns
object
Implementation of
|
public
object
|
#
getServiceByType( string $type )
Gets the service object of the specified type.
Gets the service object of the specified type.
Parameters
Returns
object
|
public
array
|
#
getServiceNamesByTag( string $tag )
Gets the service objects of the specified tag.
Gets the service objects of the specified tag.
Parameters
Returns
array of [service name => tag attributes]
|
public
boolean
|
#
hasService( string $name )
Does the service exist?
Parameters
Returns
boolean
Implementation of
|
public
boolean
|
#
checkServiceType( string $name, string $type )
Checks the service type.
Parameters
- $name
string
- $type
string
Returns
boolean
|
public
mixed
|
#
expand( mixed $s )
Expands %placeholders% in string.
Expands %placeholders% in string.
Parameters
Returns
mixed
|
public
object
&
|
#
__get( string $name )
Gets the service object, shortcut for getService().
Gets the service object, shortcut for getService().
Parameters
Returns
object
Throws
MemberAccessException if the property is not defined.
|
public
|
#
__set( string $name, object $service )
Adds the service object.
Parameters
- $name
string
- $service
object
Throws
MemberAccessException if the property is not defined or is read-only
|
public
boolean
|
#
__isset( string $name )
Does the service exist?
Parameters
Returns
boolean
|
public
|
#
__unset( string $name )
Removes the service, shortcut for removeService().
Removes the service, shortcut for removeService().
Parameters
- $name
string property name
Throws
MemberAccessException
|
Properties summary
public
array
|
$params
|
array() |
|