Today’s tutorial we are showing how to redirect to previous page from a custom action in magento 2.
This will be useful when you have an error message to show after a form submission.
namespace Vendor\Module\Controller\Adminhtml\Index; class Fetch extends \Magento\Backend\App\Action { public function execute() { // TODO: Implement execute() method. $this->_redirect($this->_redirect->getRefererUrl()); } }
Thank you so much for writing about magento 2.