$button = Mage::app()->getLayout()->createBlock('adminhtml/widget_button');
$button->setData(array(
'label' => $this->__('Some label'),
'type' => 'submit',
'class' => 'button'
));
我有上面提到的代码,它创建了一个字段元素。现在我已经有了以下Fieldset
$fieldset = $form->addFieldset('display', array(
'legend' => $helper->__('Connection Settings'),
'class' => 'fieldset-wide'
));
如何将按钮添加到字段集中。
谢谢,
答案 0 :(得分:1)
这应该可以解决问题:
$button = $this->getLayout()->createBlock('adminhtml/widget_button', '', array(
'type' => 'button',
'label' => $this->__('Some label'),
'class' => 'button'
));
$fieldset->addField('my_button', 'note', array(
'text' => $button->toHtml()
));