class Container extends Component implements IContainer

ComponentContainer is default implementation of IContainer.

Methods

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

Adds the component to the container.

void
removeComponent(IComponent $component)

Removes the component from the container.

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

Returns component specified by name or path.

IComponent|null
createComponent(string $name)

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

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

Iterates over descendants components.

void
validateChildComponent(IComponent $child)

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

__clone()

Object cloning.

Container|null
_isCloning()

Is container cloning now?

Details

at line 37
IContainer addComponent(IComponent $component, string|null $name, string $insertBefore = null)

Adds the component to the container.

Parameters

IComponent $component
string|null $name
string $insertBefore

Return Value

IContainer

Exceptions

InvalidStateException

at line 89
void removeComponent(IComponent $component)

Removes the component from the container.

Parameters

IComponent $component

Return Value

void

at line 105
final IComponent|null getComponent(string $name, bool $throw = true)

Returns component specified by name or path.

Parameters

string $name
bool $throw

Return Value

IComponent|null

at line 149
protected IComponent|null createComponent(string $name)

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

Parameters

string $name

Return Value

IComponent|null

at line 168
final Iterator getComponents(bool $deep = false, string $filterType = null)

Iterates over descendants components.

Parameters

bool $deep
string $filterType

Return Value

Iterator

at line 187
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 198
__clone()

Object cloning.

at line 216
final Container|null _isCloning()

Is container cloning now?

Return Value

Container|null