class Container extends Component implements IContainer

ComponentContainer is default implementation of IContainer.

Properties

Iterator read-only $components

Methods

addComponent(IComponent $component, $name, $insertBefore = null)

Adds the specified component to the IContainer.

void
removeComponent(IComponent $component)

Removes a component from the IContainer.

IComponent|null
getComponent($name, $throw = true)

Returns component specified by name or path.

IComponent|null
createComponent($name)

Component factory. Delegates the creation of components to a createComponent method.

getComponents($deep = false, $filterType = null)

Iterates over components.

void
validateChildComponent(IComponent $child)

Descendant can override this method to disallow insert a child by throwing an Nette\InvalidStateException.

__clone()

Object cloning.

IComponent|null
_isCloning()

Is container cloning now?

Details

at line 38
IContainer addComponent(IComponent $component, $name, $insertBefore = null)

Adds the specified component to the IContainer.

Parameters

IComponent $component
$name
$insertBefore

Return Value

IContainer

Exceptions

InvalidStateException

at line 97
void removeComponent(IComponent $component)

Removes a component from the IContainer.

Parameters

IComponent $component

Return Value

void

at line 115
IComponent|null getComponent($name, $throw = true)

Returns component specified by name or path.

Parameters

$name
$throw

Return Value

IComponent|null

at line 180
protected IComponent|null createComponent($name)

Component factory. Delegates the creation of components to a createComponent method.

Parameters

$name

Return Value

IComponent|null

at line 201
Iterator getComponents($deep = false, $filterType = null)

Iterates over components.

Parameters

$deep
$filterType

Return Value

Iterator

at line 222
protected void validateChildComponent(IComponent $child)

Descendant can override this method to disallow insert a child by throwing an Nette\InvalidStateException.

Parameters

IComponent $child

Return Value

void

Exceptions

InvalidStateException

at line 233
__clone()

Object cloning.

at line 252
IComponent|null _isCloning()

internal  
 

Is container cloning now?

Return Value

IComponent|null