2

I am creating custom module which redirect to login if third party module route id find.(frontend)

but i have issue how to identify the current route is default or third party route ?

how to check current route is default or third party ?

1 Answer 1

0

I can give you some hint for this problem.
You can try by looking into class \Magento\Framework\App\Route\Config at file

vendor/magento/framework/App/Route/Config.php

the function _getRoutes of Magento2 will return list of route's info as below.
(You may have to extend a new class from this because the scope of function is protected ) enter image description here

Based on current route as a frontName, you can extract the module info of this route as modules. From that you can know whether this module belong to Magento 2 default route or not.
I hope this will work for you.

2
  • Please explain with running example.
    – Msquare
    Commented Mar 23, 2020 at 2:15
  • My Question is how to identify the current page route is magento default route or Third party route ??
    – Msquare
    Commented Mar 23, 2020 at 2:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.