Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Adobe Exam AD0-E716 Topic 12 Question 49 Discussion

Actual exam question for Adobe's AD0-E716 exam
Question #: 49
Topic #: 12
[All AD0-E716 Questions]

An Adobe Commerce Developer wishes to add an action to a pre-existing route, but does not wish to interfere with the functionality of the actions from the original route.

What must the developer do to ensure that their action works without any side effects in the original module?

Show Suggested Answer Hide Answer
Suggested Answer: A

To add an action to a pre-existing route without interfering with the functionality of the original route, the developer must use the before or after parameters in the route declaration. This will load the developer's module in before or after the original module, respectively.

For example, the following code would add an action to the my_module/index route before the action from the original module:

<route id='my_module/index'>

<before>my_module_before</before>

</route>

The my_module_before action would be executed before the MyModuleControllerIndex action, which would allow the developer to perform any necessary setup before the original action is executed.


Contribute your Thoughts:

William
2 days ago
I disagree, I think A) is the better option. By using the before or after parameters, you can ensure your module is loaded in the right order without interfering with the original functionality.
upvoted 0 times
...
Hildred
2 days ago
I think B) sounds like the way to go. Injecting the new action into the standard router constructor's $actionlist parameter seems like the most straightforward approach.
upvoted 0 times
...

Save Cancel