ExamGecko
Question list
Search
Search

Question 26 - AD0-E717 discussion

Report
Export

A developer is working on a task that includes a custom controller creation. A controller should forward the request to a different action.

How can the developer complete this task?

A.
Specify the forward action in the controllerjorward.xml configuration file.
Answers
A.
Specify the forward action in the controllerjorward.xml configuration file.
B.
Implement a forwardToAction method in the controller, and return the action where the request should be forwarded.
Answers
B.
Implement a forwardToAction method in the controller, and return the action where the request should be forwarded.
C.
Return the forward object with action as an argument in the object's forward method
Answers
C.
Return the forward object with action as an argument in the object's forward method
Suggested answer: C

Explanation:

To forward the request to a different action, the developer can use the following code in the controller:

return $resultForward->forward('action');

where $resultForward is an instance of \Magento\Framework\Controller\Result\ForwardInterface and 'action' is the name of the action where the request should be forwarded.

There is no controllerjorward.xml configuration file or forwardToAction method in Adobe Commerce.

Verified

Reference: [Adobe Commerce Developer Guide - Forward action result]

asked 02/10/2024
Petros Kapouleas
46 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first