duan0708676887 2015-01-08 08:32
浏览 46
已采纳

如何在magento的Controller中添加一个动作?

 $fieldset->addField('test_connection', 'submit', array(
            'label'     => Mage::helper('rpos_connect')->__('Test Connection'),
            'required'  => true,
            'value'  => 'Test',
            'after_element_html' => '',
            'tabindex' => 1

        ));

This is my PHP code to prepare a form with a button in my module block folder.Now I want this to call a function named testAction() in my Controller class.

  • 写回答

1条回答 默认 最新

  • dongshu7162 2015-01-08 09:24
    关注

    You can use onclick as follows.

    'onclick' => "setLocation('{$this->getUrl('*/controller/action')}')"
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?