定制模块条件配置选项 [英] Custom module conditional configuration optons
问题描述
我想根据选择的状态以编程方式在管理面板上启用或禁用自定义模块的特定选项.例如,如果我选择是/否,则选择类似
I would like to programmatically enable or disable specific options for a custom module on the administration panel depending on the status of a select. For example, if I had a Yes/No select something like
do you want to handle stuffs? < select yes/no >
,如果stuffs ==是,那么将启用/显示许多其他配置字段.如果东西!=是,那么这些字段将被禁用/不可见.
and if stuffs == yes, then a number of other configuration fields would be enabled/visible. If stuffs != yes then those fields would be disabled/invisible.
是否可以通过system.xml
/some-other-means进行编程编程,还是科幻梦dream以求的?
Is that possible to do programmatically via system.xml
/some-other-means, or it is a sci-fi dream?
感谢您的帮助.
推荐答案
是的,这是可能的.您对system.xml
中的<depends>
标记感兴趣.您可以在此处(自链接)进行阅读.通常的想法是,您可以使字段 的外观依赖于另一个包含特定值的字段.
Yes, this is possible. You're interested in the <depends>
tag in system.xml
. You can read up about it here (self link). The general idea is you can make the appearance of a field depend on another field containing a specific value.
这篇关于定制模块条件配置选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!