Php 将字段添加到magento中的自定义模块管理部分

Php 将字段添加到magento中的自定义模块管理部分,php,magento,Php,Magento,我已经用模块创建者创建了自定义模块,它看起来不错,现在我想在其中添加一个新字段,但不知何故我不能这样做。我已经在位于Adminhtml/Modulename/Edit/Tab的文件Form.php中添加了以下几行内容: $fieldset->addField('titlenew', 'text', array( 'label' => Mage::helper('test')->__('Title New'), 'class' =>

我已经用模块创建者创建了自定义模块,它看起来不错,现在我想在其中添加一个新字段,但不知何故我不能这样做。我已经在位于Adminhtml/Modulename/Edit/Tab的文件Form.php中添加了以下几行内容:

$fieldset->addField('titlenew', 'text', array(
      'label'     => Mage::helper('test')->__('Title New'),
      'class'     => 'required-entry',
      'required'  => true,
      'name'      => 'titlenew',
  ));

该字段正在出现,但数据未保存。需要帮助。

您需要向与正在编辑的实体相关联的表中添加新列。
将其命名为与字段
titlenew
相同的名称。然后清除缓存。

即使已禁用缓存,ZF也会缓存表架构。

您需要向与正在编辑的实体关联的表中添加新列。
将其命名为与字段
titlenew
相同的名称。然后清除缓存。

即使禁用了缓存,ZF也会缓存表架构。

您需要创建一个升级脚本,以便在db表中添加一个新列,请查看@


然后按照@Marius的建议清除缓存。您需要创建一个升级脚本,以便在db表中添加一个新列。请查看@


然后按照@Marius的建议清除缓存,将titlenew更改为titlenew2,并将“Title New”标记为Title New2

$fieldset->addField('titlenew2', 'text', array(
      'label'     => Mage::helper('test')->__('Title New2'),
      'class'     => 'required-entry',
      'required'  => true,
      'name'      => 'titlenew2',
  ));

将titlenew更改为titlenew2,并将标签“Title New”更改为Title New2

$fieldset->addField('titlenew2', 'text', array(
      'label'     => Mage::helper('test')->__('Title New2'),
      'class'     => 'required-entry',
      'required'  => true,
      'name'      => 'titlenew2',
  ));

+1用于清除缓存,即使它已禁用。这是我的问题。我在我的开发设备上关闭了缓存,所以我没有想到清除缓存。+1用于清除缓存,即使它被禁用。这是我的问题。我把缓存放在我的开发设备上,所以我没有想清除缓存。