在Magento 1.x 中,我们用下面代码读取 `core_config_data` 中的值: Mage::getStoreConfig('sections/groups/fields') 而在Magento 2.0 中,我们用下面方法读取 ‘core_config_data’ 的值: public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, ) { $this->_scopeConfig = $scopeConfig; } public function helloWorld(){ $showTemplateHint = $this->_scopeConfig->getValue('dev/debug/template_hints', \Magento\Store\Model\ScopeInterface::SCOPE_STORE); }

分类: web

标签: