回答:
\Magento\Framework\App\Config\ScopeConfigInterfaceブロックでのインスタンスを使用する必要があります。
メソッドを作成する getStoreName()
public function getStoreName()
{
    return $this->_scopeConfig->getValue(
        'general/store_information/name',
        \Magento\Store\Model\ScopeInterface::SCOPE_STORE
    );
}そしてテンプレートを呼び出します echo $this->getStoreName()
\Magento\Store\Model\StoreManagerInterface $storeManager   コンストラクタにし、    public function getStoreName()       {           return $this->storeManager->getStore()->getName();       }   代わりにgetName()あなたが使用することができgetCode()、getId()。
                    アクティブなストアに関する情報を保持するストアマネージャーを使用します。カスタムブロックがブロックから継承されていない場合、コンストラクトにTemplate依存関係を注入し\Magento\Store\Model\StoreManagerInterfaceます。
<?php
namespace VendorName\ModuleName\Block;
class CustomBlock extends \Magento\Framework\View\Element\Template
{
    /**
     * Get current store name.
     *
     * @return string
     */
    public function getCurrentStoreName()
    {
        return $this->_storeManager->getStore()->getName();
    }
}次にテンプレートで:
<?php
/**
 * @var $block \VendorName\ModuleName\Block\CustomBlock
 */
echo "<h1>Current store name is '{$block->getCurrentStoreName()}'</h1>";
?>general/store_information/name以下のようなストア構成値を取得するには
$config = new \Magento\Framework\App\Config\ScopeConfigInterface();
echo $config->getValue('general/store_information/name');ただし、ブロックまたはヘルパーからこれを行うと、よりクリーンになります。以下は、独自のカスタムモジュールに存在するヘルパークラスです。
namespace [Namespace]\[Module]\Helper;
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
    /**
     * Retrieve store name
     *
     * @return string|null
     */
    public function getStoreName()
    {
        return $this->scopeConfig->getValue(
            'general/store_information/name',
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE
        );
    }
}ブロッククラスに依存関係として注入するもの