0
我有一个Magento模块,它允许您通过管理界面将字符串保存到Magento中的核心配置表中。当字符串保存在后端时,我有一个观察者设置来运行一个方法。我试图拦截字符串并在将其保存到数据库之前对其进行编码。Magento事件/观察者对象getData问题
所以,当被触发我的情况下运行这样的:
public function myModSaved($observer)
{
echo "<h1> WOWSERS IT ACTUALLY WORKED!!</h1>";
$data = $observer->getData();
print_r($data);
}
输出看起来是这样的:
Array ([event] => Varien_Event Object ([_observers:protected] => Varien_Event_Observer_Collection Object ([_observers:protected] => Array ()) [_data:protected] => Array ([website] => [store] => [name] => admin_system_config_changed_section_mymodule_section) [_hasDataChanges:protected] => [_origData:protected] => [_idFieldName:protected] => [_isDeleted:protected] => [_oldFieldsMap:protected] => Array () [_syncFieldsMap:protected] => Array ()) [website] => [store] =>)
现在只有被写入到数据库中的一个字符串,我怎么弄该字符串保存之前,然后将我的新修改的字符串添加到对象,以便保存在数据库中?
在此先感谢!