How to get value from “core_config_data” table in Magento 2?

First you need to create object of Scope Config Interface , You can create it by constructor or by Object Manager.
Using Constructor
Inject the an instance of \Magento\Framework\App\Config\ScopeConfigInterface in your block.

protected $scopeConfig;

public function __construct()
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
) {
$this->scopeConfig = $scopeConfig;
Then create the method:
public function getStoreName()
return $this->scopeConfig->getValue(
 And call in your template:
echo $this->getStoreName()

Using ObjectManager
If you are having object of ObjectManager then you can get config as below


Do you need support to implement Magento 2 codes?

Contact Now

Leave a Reply