class
CustomersController
extends
BaseController { }
How do we decouple this from the framework? We’re immediately extending from the frame-
work, meaning that every piece of code we write in this class from here on out is going to be
coupled to our controller. It is not just the extension of
BaseController
, either; it is all the other
mechanisms that this class provides us that our code begins to rely on.
Using Adapters to Wrap Your Controller
One approach you can take is to write controllers completely removed from your application.
These essentially become very similar to services:
Do'stlaringiz bilan baham: |