Magento如何将自定义字段添加到角色创建表单并将其值保存到数据库

时间:2015-05-06 11:19:55

标签: magento

enter image description here我需要在“角色创建”表单中添加一个额外的字段。

我能通过两种方式做到   - 使用事件观察器   - 或者通过重写块

但我想将此字段保存到数据库中,并希望在编辑角色页面上填充此值。

我试过了 -

$fieldset = $form->addFieldset('navigator_information', array(
            'legend' => 'Navigator Information',
            'class' => 'fieldset-wide'
                )
          );

      $options = array();
      $options['client'] = 'client'; 
      $options['report'] = 'report';

          //add new field
          $fieldset->addField('navigator_role', 'select',
            array(
                'name'  => 'navigator_role',
                'label' => Mage::helper('adminhtml')->__('Navigator Roles'),
                'id'    => 'navigator_role',
                'class' => 'required-entry',
        'values' => $options,
                'required' => true,
              )
          );

它显示了新的字段集和新字段,但如何存储此值
进入db?

任何帮助将不胜感激。

我上传了显示新字段的屏幕截图

0 个答案:

没有答案