Container
class Container extends Component implements IContainer
Manages a collection of child components.
Constants
| private NameRegexp |
|
Methods
Adds a child component to the container.
Retrieves a child component by name or creates it if it doesn't exist.
Creates a new component. Delegates creation to createComponent
Returns all immediate child components.
Retrieves the entire hierarchy of components, including all nested child components (depth-first).
Validates a child component before it's added to the container.
Handles object cloning. Clones all child components and re-sets their parents.
Is container cloning now?
Details
at line 33
IContainer
addComponent(IComponent $component, string|null $name, string|null $insertBefore = null)
Adds a child component to the container.
at line 89
void
removeComponent(IComponent $component)
Removes a child component from the container.
at line 106
final IComponent|null
getComponent(string $name, bool $throw = true)
Retrieves a child component by name or creates it if it doesn't exist.
at line 149
protected IComponent|null
createComponent(string $name)
Creates a new component. Delegates creation to createComponent
at line 175
final iterable
getComponents()
Returns all immediate child components.
at line 191
final array
getComponentTree()
Retrieves the entire hierarchy of components, including all nested child components (depth-first).
at line 209
protected void
validateChildComponent(IComponent $child)
Validates a child component before it's added to the container.
Descendant classes can override this to implement custom validation logic.
at line 220
__clone()
Handles object cloning. Clones all child components and re-sets their parents.
at line 241
final Container|null
_isCloning()
| internal |
Is container cloning now?