Cmd/Ctrl + K

Service container

The Annabel application is also the service container and implements Psr\Container\ContainerInterface.

Bind services

Register bindings when the container needs instructions for constructing a service.

Resolve services

Resolve services directly when no framework-managed injection point is available.

Named constructor parameters may be passed during resolution:

Passing parameters to an already resolved singleton throws an exception.

Constructor injection

Controllers, commands, and container-resolved services may type-hint dependencies. The container resolves them recursively when possible.