Hi today i'm working on system.xml file. it's not saving correctly.
system.xml
<custom_field translate="label">
<label>Add Class and it's Params</label>
<frontend_model>hello/adminhtml_form_field_addclass</frontend_model>
<backend_model>hello/system_config_backend_addclass</backend_model>
<sort_order>6</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
</custom_field>
Test\Block\Adminhtml\Form\Field\AddClass.php
<?php
class Test_Hello_Block_Adminhtml_Form_Field_AddClass extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
{
protected function _prepareToRender()
{
$this->addColumn('add_param', array(
'label' => Mage::helper('hello')->__('Add Parameter'),
));
$this->addColumn('add_param_class', array(
'label' => Mage::helper('hello')->__('Add Parameter Class'),
'style' => 'width:100px',
));
$this->addColumn('add_param_class_field', array(
'label' => Mage::helper('hello')->__('Add Parameter Class Fields'),
'style' => 'width:100px',
));
$this->_addAfter = false;
$this->_addButtonLabel = Mage::helper('hello')->__('Add Class');
}
}
Test\Model\System\Config\Backend\AddClass.php
<?php
/**
* Backend for serialized array data
*
*/
class Test_Hello_Model_System_Config_Backend_AddClass extends Mage_Core_Model_Config_Data
{
/**
* Process data after load
*/
protected function _afterLoad()
{
$value = $this->getValue();
Mage::log($value,null,'AddClass');
//$this->setValue($value);
}
/**
* Prepare data before save
*/
protected function _beforeSave()
{
$value = $this->getValue();
//$this->setValue($value);
Mage::log($value,null,'AddClass');
}
}
it's saving core_config_data table like below formate.
path = customtab/custom_attributes/custom_field
value = Array,Array,Array,
Logs are created like below formate
2015-08-10T10:42:55+00:00 DEBUG (7): Array,
2015-08-10T10:58:26+00:00 DEBUG (7): Array
(
[_1439204268814_814] => Array
(
[add_param] => acceptNewClass
[add_param_class] => AcceptNewClassFields
[add_param_class_field] => ID,PrimariContact
)
[_1439204284271_271] => Array
(
[add_param] => TokenID
[add_param_class] =>
[add_param_class_field] =>
)
[_1439204298185_185] => Array
(
[add_param] => memberID
[add_param_class] =>
[add_param_class_field] =>
)
[__empty] =>
)
how to save & retrieve this?
Any help on this
Thanks.
System->Configuration->Design