trait HasContainerTrait (View source)

Holds an IoC container.

Methods

Container
container()

Get the IoC container instance.

void
setContainer(Container $container)

Set the IoC container instance.

mixed|null
resolve(string $key)

Resolve a dependency from the IoC container.

Details

Container container()

Get the IoC container instance.

Return Value

Container

void setContainer(Container $container)

Set the IoC container instance.

Parameters

Container $container

Return Value

void

mixed|null resolve(string $key)

Resolve a dependency from the IoC container.

Parameters

string $key

Return Value

mixed|null