1 of 3

You can write code in Helper/Data.php to get store url and using data helper call that method in admin page

for example

Helper/Data.php

public function getStoreUrl(){
    $storeId = $this->_storeManager->getDefaultStoreView()->getStoreId();
    $url = $this->_storeManager->getStore($storeId)->getUrl("sample/index/test");
return $url;

}

In admin page In block

public function __construct(
    \Namespace\Modulename\Helper\Data $_dataHelper
) {
    $this->_dataHelper = $_dataHelper;
}

get url - $this->_dataHelper->getStoreUrl();

In phtml

$block->helper('Namespace\Modulename\Helper\Data')->getStoreUrl();