AD0-E716 · Question #4
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…
The correct answer is C. Option C. The plugin execution order is as follows: PluginA::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…
Question
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)
Exhibit
Options
- AOption A
- BOption B
- COption C
How the community answered
(23 responses)- A22% (5)
- B9% (2)
- C70% (16)
Explanation
The plugin execution order is as follows: PluginA::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: beforeDispatch() aroundDispatch() beforeDispatch()
Topics
Community Discussion
No community discussion yet for this question.
