$loaded
$loaded : array
Anax base class implementing Dependency Injection / Service Locator of the services used by the framework, using lazy loading.
get(string $service) : mixed
Finds an entry in the container by its identifier and returns it.
If the service is active/singelton then that instance is returned, else the service is loaded and a new instance is returned.
| string | $service | Identifier of the entry to look for. |
No entry was found for this identifier.
Error while retrieving the entry.
Entry.
has(string $service) : boolean
Returns true if the container can return an entry for the given identifier, otherwise false
has($id) returning true does not mean that get($id) will not
throw an exception.
It does however mean that get($id) will not throw a
NotFoundException.
| string | $service | Identifier of the entry to look for. |
set(string $service, mixed $loader) : void
Set a service and connect it to a task which creates the object (lazy loading).
| string | $service | as a service label, naming this service. |
| mixed | $loader | contains a pre-defined object, a string with class name or an callable which returns an instance of the service object. Its the way to actually load, insantiate, the service object. |
setShared(string $service, mixed $loader) : void
Set a singleton service and connect it to a task which creates the object (lazy loading).
| string | $service | as a service label, naming this service. |
| mixed | $loader | contains a pre-defined object, a string with class name or an callable which returns an instance of the service object. Its the way to actually load, insantiate, the service object. |