Alexa.com announced, the company stopped offering new subscriptions on December 8th, 2020 & will shut down the site on May 1st, 2022
Twenty-five years ago, we founded Alexa Internet. After two decades of helping you find, reach, and convert your digital audience, we’ve made the difficult decision to retire Alexa.com on May 1, 2022. Thank you for making us your go-to resource for content research, competitive analysis, keyword research, and so much more.,” wrote Alexa Internet’s official statement.
<?php
namespace Mage2db\John\Helper;
use Magento\Store\Model\StoreManagerInterface;
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
protected $storeManager;
/**
* @param \Magento\Framework\App\Helper\Context $context
*/
public function __construct
(
\Magento\Framework\App\Helper\Context $context, StoreManagerInterface $storeManager
)
{
$this->storeManager = $storeManager;
parent::__construct($context);
}
public function getStoreManagerData()
{
//return $storeUrl = $this->storeManager->getStore()->getBaseUrl();
// get Store Url without index.php
return $storeUrl = $this->storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_WEB);
// get Link Url of store
// $storeLinkUrl = $this->storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_DIRECT_LINK);
// get media Base Url
// $storeMediaUrl = $this->storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
// get Static content Url
// $storeStaticUrl = $this->storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_STATIC);
}
}
in above Helper/Data.php , we have defined getStoreManagerData()
By using below code, anywhere inside module we can use getStoreManagerData()
$this->helperData->getStoreManagerData();
Finally once all command method defined inside Helper/Data.php, we can use anywhere inside module.