Is this possible to get admin path url in custom module controller? How can I get for Magento 2x? there I don't have default admin in path.
<?php
/**
* Copyright © 2015 Technologymindz. All rights reserved.
*/
namespace Technologymindz\Instagramfeed\Controller\Adminhtml\Insta;
use Magento\Framework\Controller\ResultFactory;
class Auth extends \Technologymindz\Instagramfeed\Controller\Adminhtml\Insta
{
public function __construct(
//other stuff you need here
\Magento\Framework\App\DeploymentConfig\Reader $configReader
) {
$this->configReader = $configReader;
//other stuff you need here, like parent::__construct($context, $data);
}
/**
* Items list.
*
* @return \Magento\Backend\Model\View\Result\Page
*/
public function execute()
{
$config = $this->configReader->load();
$adminSuffix = $config['backend']['frontName'];
echo $adminUrl = $this->_storeManager->getStore()->getBaseUrl() . $adminSuffix;
die;
}
}