【发布时间】:2013-05-27 08:25:30
【问题描述】:
我正在扩展的模块使用addField() 将字段添加到管理表单。我复制了这种行为,因为我认为我会尝试坚持他们的设置。但是,我不知道如何在这些字段的右侧添加“使用默认值”复选框。这是一个问题,因为我要添加一个需要特定于站点的字段。
为了后代的代码:
$fieldset->addField('enable_coupon', 'select', array(
'label' => Mage::helper('affiliatepluscoupon')->__('Enable Coupon'),
'name' => 'enable_coupon',
'note' => Mage::helper('affiliatepluscoupon')->__('If yes then it will create a magento salesrule for this store.'),
'values' => Mage::getSingleton('adminhtml/system_config_source_yesno')->toOptionArray(),
));
为了澄清,我正在寻找由管理字段放置的动态复选框,该复选框会根据您所在的视图而变化。这在通过 XML 创建字段时会自动显示,但在使用 addField() 添加字段时似乎被遗漏了。
【问题讨论】:
-
是的,我在商店视图中。我正在研究现在发布的两个答案。
标签: magento