I am trying to build a module that has a custom front-end router on magento 2.1.12. I am following magento doc & I am using the inchoo custom router example.
The problem is the route (MY-SITE/matinteg/orders) throws
Front controller reached 100 router match iterations
error when ever I try to reach it. I tried to flush & remove cache, cache_page, progress, ... so it doesn't seem to be mis-configured or problematic cache. I also upgrade, compile, deploy & flush cache so many time. But there was no luck.
The $request returns a complete object and everything seems to be true, but still I get the error.
I have
vendor_module/Controller/Router.php
public function match(\Magento\Framework\App\RequestInterface $request){ if($request->getModuleName() == 'cms'){ $identifier = trim($request->getPathInfo(), '/'); if(strpos($identifier, 'matinteg/orders') !== false) { /* * We must set module, controller path and action name for our controller class(Controller/Test/Test.php) */ $request->setModuleName('cms')->setControllerName('integration')->setActionName('integration'); } else { //There is no match return; } /* * We have match and now we will forward action */ return $this->actionFactory->create( 'Magento\Framework\App\Action\Forward', ['request' => $request] ); } }
The rest of the files are pretty identical to inchoo sample. I have
vendor_module/Controller/Integration/Integration.php
vendor_module/etc/frontend/routes.xml
I tried to hire the solution in this stack but it was not helpful either