To support our customers during COVID-19 pandemic, we had introduced many
offers and discounts
to help your ecommerce businesses. Learn more

Magento 2 - How to get admin side base URL?

Magento 2 - How to get admin side base URL?

Use below code to get Admin base URL. It will work on any php or phtml file.

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

Output:
http://YOUR_DOMAIN.COM/ADMIN_URL/admin/

December 16, 2017
Did you like this post?
0
0