Routes and Controllers
Many of us rely heavily on a framework’s router and controller mechanisms, as the vast majority
of PHP frameworks are MVC-oriented.
How do you go about abstracting the usage of routes and controllers so that you don’t tightly
couple yourself to them? This is the hardest part of an application to implement in the Clean
Architecture. Routes and controllers are the entry point of your application. It is the basis by
which all other work in the application is triggered.
It is pretty hard to decouple yourself completely from the framework, unless you actually stop
using it. Just think about it: your first step after defining some route is to define some controller
logic. This usually involves extending from some base or abstract controller:
Do'stlaringiz bilan baham: |