[英]Adding field to custom module admin section in magento
我已經使用模塊創建者創建了自定義模塊,並且它看起來還不錯,現在我想在其中添加一個新字段,以某種方式我無法做到這一點。我向位於Adminhtml /中的 Form.php文件添加了以下幾行模塊名稱/編輯/標簽 :
$fieldset->addField('titlenew', 'text', array(
'label' => Mage::helper('test')->__('Title New'),
'class' => 'required-entry',
'required' => true,
'name' => 'titlenew',
));
出現該字段,但數據未保存。需要幫助。
您需要在與要編輯的實體相關聯的表中添加新列。
將其命名為字段titlenew
。 並清除緩存。
即使禁用了緩存,ZF也會緩存表架構。
將titlenew更改為titlenew2並將標簽“ Title New”更改為Title New2
$fieldset->addField('titlenew2', 'text', array(
'label' => Mage::helper('test')->__('Title New2'),
'class' => 'required-entry',
'required' => true,
'name' => 'titlenew2',
));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.