Dependency Injection
Introduction
doMynation uses dependency injection to wire dependencies across the framework.
Container-Aware Entities
Below is the list of classes and methods supplied by the framework that are aware of the dependency injection container, which means they can be injected dependencies via constructor arguments or function/method arguments:
The
Module::boot()
methodClosures of simple routes
Constructor of Actions and their optional
validate()
methodConstructor of
RouteMiddleware
Core Dependencies
The framework registers and makes the following dependencies available in any container-aware entity:
Class/Interface | Description |
| The current request. |
| The framework's router to register routes. |
| The utility for loading templates/views and register namespaces. |
| The command bus. |
| The currently logged-in user (if any). |
| Doctrine's ORM. |
| The utility to store and retrieve data from the cache. |
| The utility to store files. |
| The utility to send emails. |
| The event dispatcher, to fire and listen for events. |
Last updated