class Container extends Component implements IContainer

ComponentContainer is default implementation of IContainer.

Properties

ArrayIterator read-only $components

Methods

void
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, $need = TRUE)

Returns component specified by name or path.

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.

null|IComponent
_isCloning()

Is container cloning now?

Details

at line 38
void addComponent(IComponent $component, $name, $insertBefore = NULL)

Adds the specified component to the IContainer.

Parameters

IComponent $component
$name
$insertBefore

Return Value

void

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, $need = TRUE)

Returns component specified by name or path.

Parameters

$name
$need

Return Value

IComponent|null

at line 180
protected IComponent createComponent($name)

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

Parameters

$name

Return Value

IComponent

the created component (optionally)

at line 201
Iterator getComponents($deep = FALSE, $filterType = NULL)

Iterates over components.

Parameters

$deep
$filterType

Return Value

Iterator

at line 223
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 234
__clone()

Object cloning.

at line 253
null|IComponent _isCloning()

internal  
 

Is container cloning now?

Return Value

null|IComponent