What would be the plugin execution order?
The di. xml file of a module attaches two plugins for the class Action.
The PluginA has the methods: beforeDispatch, aroundDispatch, afterDispatch.
The PluginB has the methods: beforeDispatch, afterDispatch.
The around plugin code is:
What would be the plugin execution order?
A)
B)
C)
A . Option A
B. Option B
C. Option C
Answer: C
Explanation:
The plugin execution order is as follows:
PluginA::beforeDispatch()
PluginB::beforeDispatch()
PluginA::aroundDispatch()
The code in the around plugin
PluginB::afterDispatch()
PluginA::afterDispatch()
The aroundDispatch() method is executed in a separate scope, so the code in the around plugin will be executed after the beforeDispatch() methods of both plugins, but before the afterDispatch() methods of both plugins.
Here is a diagram that shows the plugin execution order:
PluginA
beforeDispatch()
aroundDispatch()
afterDispatch()
PluginB
beforeDispatch()
afterDispatch()
Latest AD0-E716 Dumps Valid Version with 69 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund