-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
By design, all Magento action controllers should implement \Magento\Framework\App\ActionInterface. But some crucial request processing behavior (event dispatching, authorisation, etc) resides in classes like \Magento\Framework\App\Action\Action and \Magento\Backend\App\AbstractAction. So if an action controller implements the ActionInterface but does not inherit from one of these "layer supertype" classes, it will lose that crucial behavior.
So, Magento module developers do not have a way to create an action controller without using inheritance. To avoid inheritance (see why), the request processing behavior should be extracted from "layer supertypes". Proposed solution is to move the behavior to action controller plugins.
Action controller should contain only its custom behavior.
AC:
- module developer does not have to extend from any class to create a fully functional action controller, implementing
\Magento\Framework\App\ActionInterfaceis enough - controllers "supertypes" (
\Magento\Backend\App\AbstractAction,\Magento\Framework\App\Action\Action,\Magento\Framework\App\Action\AbstractAction) are deprecated - magento supports both controller implementations (inheritance based and non-inheritance based)
- [optional] controllers are migrated