我创建了一个模块,它有一个"export like"方法,定期运行,如我在模块的config.xml文件的cron区域中定义的那样.但是我想让用户能够通过在系统配置中添加"立即运行"按钮来按需运行此导出方法,从而使用system.xml文件.
看起来"前端类型"按钮可能正如我所尝试的那样工作,它在配置部分添加了一个微小的可点击按钮.但是我无法在按钮本身上附加方法或标签.
我想在模块的"Grid.php"文件中添加一个按钮,但这不是我想做的,因为它适合我的acl.
下面是我的带有"按钮"前端类型的system.xml文件.
有没有人知道如何:
非常感谢您的帮助 !
<?xml version="1.0" encoding="UTF-8"?>
<config>
...
<fields>
...
<run translate="label">
<label>Run now</label>
<frontend_type>button</frontend_type>
<backend_model>SOME BACKEND MODEL</backend_model>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</run>
</fields>
...
</config>
Run Code Online (Sandbox Code Playgroud) magento ×1