magento 2 system.xml 用法解析

本文内容来自QQ群大佬陈伟明(一叶知秋)的学习分享

 

system.xml后台设置选项的位置

对应的表是 core_config_data




Magento\Config\Model\Config\Source\Yesno //系统下的source_model,都在 Magento\Config\Model\Config\Source下面,类里面主要看 public function toOptionArray()方法 1 Aune\Stripe\Model\Adminhtml\Source\PaymentAction //自定义的 source_model 一般也是后台会用到 Vendor\Module\Model\Adminhtml\Source 下面 1 1 Magento\Config\Model\Config\Backend\Encrypted 1 Create customer entity in Stripe (mandatory to enable the vault). Magento\Config\Model\Config\Source\Yesno 1 Use On Session if you intend to only reuse the payment method when your customer is present in your checkout flow. Use Off Session if your customer may or may not be in your checkout flow. Aune\Stripe\Model\Adminhtml\Source\FutureUsage 1 1 Magento\Config\Model\Config\Source\Yesno Magento\Config\Model\Config\Source\Yesno payment/aune_stripe_vault/active 1

 

发表回复