A Symfony bundle that redesigns controllers and commands as automatically registered, dependency-injected services.
DunglasActionBundle is a Symfony bundle that replaces Symfony's controller and command systems with a service-oriented architecture. It automatically registers action and command classes as services, using constructor autowiring for dependency injection to promote reusable, framework-agnostic, and easily testable code.
Symfony developers seeking to improve code architecture by decoupling business logic from framework specifics, particularly those working on projects requiring high testability and maintainability.
Developers choose DunglasActionBundle for its automatic service registration and explicit dependency injection, which eliminates service container access and encourages single-action classes via the __invoke() method, leading to cleaner design and better unit testing.
Symfony controllers, redesigned
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Classes in designated directories like Action/ and Controller/ are automatically registered as Symfony services, eliminating manual service definition boilerplate as shown in the usage examples.
Dependencies are injected via constructor autowiring, removing service container access and making classes more testable and framework-agnostic, per the philosophy section.
Encourages single-action classes using the __invoke() method for cleaner, focused code, though multi-action classes are still supported for flexibility.
Maintains 100% compatibility with common bundles like SensioFrameworkExtraBundle and auto-tags commands, event subscribers, and Twig extensions without extra configuration.
The README explicitly states it's unnecessary for Symfony 3.3+, as features were ported into core, making it obsolete for new projects on recent versions.
While automatic, overriding service definitions or using non-standard directories requires explicit YAML/XML configuration, which can complicate setup for edge cases.
Despite promoting framework-agnostic code, it's tightly coupled to Symfony's DI and routing systems, limiting portability without additional bridges like PSR-7.