表格是insertcolor。和colorcode是insertcolor表的字段。 所以首先从insertcolor表中获取所有数据。然后将此数据添加到复选框字段中。所以id显示但值不显示。在id和value中我输入相同的值但不显示在checkbox的值字段中。
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$readresult=$write->query("SELECT * FROM insertcolor" );
while ( $row = $readresult->fetch() )
{
$categoryIds[]=$row;
}
foreach($categoryIds as $entity_id)
{
$fieldset->addField($entity_id['colorcode'], 'checkbox', array(
'label' => Mage::helper('selectcolorforimage')->__($entity_id['colorcode']),
'name' =>'assign_color_new[]',
'values' =>'not set vaqlue',
));
}