Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
HomePageUrlLocator.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
13 
18 {
22  private $scopeConfig;
23 
27  public function __construct(
28  \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
29  ) {
30  $this->scopeConfig = $scopeConfig;
31  }
32 
36  public function locateUrl($urlKey): ?string
37  {
38  if ($urlKey === '/') {
39  $homePageUrl = $this->scopeConfig->getValue(
42  );
43  return $homePageUrl;
44  }
45  return null;
46  }
47 }
const XML_PATH_HOME_PAGE
Definition: Page.php:31
__construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig)