cancel
Showing results for 
Search instead for 
Did you mean: 

getAdminLink for Magento 2

SOLVED

getAdminLink for Magento 2

Hello

 

I have a new question (a little one this time) as you probably know i'm trying to adapt a module from prestashop to magento so i'm searching the equivalent of :

$this->context->link->getAdminLink(---------);

for Magento 2:

help pls

Tags (1)
2 REPLIES

Re: getAdminLink for Magento 2

You can get homepage url of admin,

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
echo $objectManager->get('Magento\Backend\Helper\Data')->getHomePageUrl();

You can get other page url using,

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    	echo $objectManager->get('Magento\Backend\Model\UrlInterface')->getUrl('catalog/product/index');
If Issue Solved, Click Kudos/Accept As solutions.

Re: getAdminLink for Magento 2

thank you very much