开发者

Magento - Run a code at the launch of a module

开发者 https://www.devze.com 2023-02-03 19:13 出处:网络
Is there a way to run such a code at the launch of a module (once) to add fields in a table in the database

Is there a way to run such a code at the launch of a module (once) to add fields in a table in the database

$setup = new Mage_Eav_Model_Entity_Setup ('core_setup');
$setup-> addAttribute ('customer', 'flavor', array (
'label' => 'Ice Cream Flavour'
'type' => 'varchar',
'input' => 'text',
'visible' => true,
'required' => true,
'position' => 1,
));
开发者_开发百科

Thanks a lot for help.


You want to look into Magento Setup Resources. This is exactly what they were created for.

0

精彩评论

暂无评论...
验证码 换一张
取 消