QuestionQ8

Adobe Commerce Architecture and Customization Techniques

A module’s di.xml file registers two plugins for the Action class. PluginA defines the methods beforeDispatch, aroundDispatch, and afterDispatch. PluginB defines the methods beforeDispatch and afterDispatch.

Question Image

The around-plugin code is:

Question Image

What is the plugin execution order?

  • A
  • B
  • C
Explanation

Plugins are prioritized by sortOrder, so PluginA (10) begins before PluginB (20). An around plugin must invoke its $next callable to continue to subsequent plugins and the observed method. Because PluginA returns $request without calling $next, PluginB and Action::dispatch() are skipped; PluginA’s afterDispatch still runs after its around method returns.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!