This forum is now Read-Only. The Magento Community Forum is scheduled to close permanently on December 31, 2025. Please save any necessary information before this date. Join us on Slack for continued engagement!
Well AKAIK - in Magento 2 controller is mainly used for routing purpose - meaning to route the actual path and call the specific methods !
Controllers are responsible for processing all requests made via a url. If you hit the url yourwebsitedomain.com/index.php/mycustom/test - so in the controllers/mycustom/test.php and inside of that the viewAction() method called