initContainer.php
Table of Contents
Functions
- initContainer() : Container
- Initialize and build a PHP-DI container for the application.
Functions
initContainer()
Initialize and build a PHP-DI container for the application.
initContainer(string|array<string|int, mixed>|DefinitionSource ...$definitions) : Container
This function creates a ContainerBuilder, adds one or more definition sources, and returns the built Container. Definitions can be provided as:
- string: path to a PHP definition file (returning an array of definitions).
- array: an associative array of definitions.
- DefinitionSource: any PHP-DI compatible definition source.
Notes:
- Later definition sources can override entries defined earlier.
- To load multiple files from a directory, see initDefinitions().
Parameters
- $definitions : string|array<string|int, mixed>|DefinitionSource
-
One or more definition sources (file path(s), array(s), or DefinitionSource instances).
Tags
Return values
Container —The built dependency injection container.