1

system.xml

<field id="secret" translate="label comment" type="obscure" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
    <label>App Secret</label>
    <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
</field>

PHP部分

$secret = $this->_scopeConfig->getValue('psloginfree/facebook/secret');
/* @var \Magento\Framework\Encryption\Encryptor $encryptor */
$encryptor = $objectManager->get('Magento\Framework\Encryption\Encryptor');
$secret = trim($encryptor->decrypt($secret));

猫之良品
2.5k 声望139 粉丝

资深Drupal, magento与Joomla


引用和评论

0 条评论