xml – 添加所有代码后,不会创建magento中的自定义表
发布时间:2020-12-16 23:31:53 所属栏目:百科 来源:网络整理
导读:这是我的模块的config.xml文件的代码.看看代码并建议我错在哪里.我是magento的新手,并不太了解配置文件中使用的声明.任何帮助将不胜感激. ?xml version="1.0"?config global models xyz_xyzshipping classXyz_Xyzshipping_Model/class resourceModelxyz_xyzs
这是我的模块的config.xml文件的代码.看看代码并建议我错在哪里.我是magento的新手,并不太了解配置文件中使用的声明.任何帮助将不胜感激.
<?xml version="1.0"?> <config> <global> <models> <xyz_xyzshipping> <class>Xyz_Xyzshipping_Model</class> <resourceModel>xyz_xyzshipping_resource</resourceModel> </xyz_xyzshipping> <xyz_xyzshipping_resource> <class>Xyz_xyzshipping_Model_Resource</class> <entities> <custom> <table>xyz_xyzshipping_custom</table> </custom> </entities> </xyz_xyzshipping_resource> </models> <resources> <xyz_xyzshipping_setup> <setup> <module>Xyz_Xyzshipping</module> </setup> </xyz_xyzshipping_setup> </resources> <blocks> <xyz_xyzshipping> <class>Xyz_Xyzshipping_Block</class> </xyz_xyzshipping> </blocks> <helpers> <xyz_xyzshipping> <class>Xyz_Xyzshipping_Helper</class> </xyz_xyzshipping> </helpers> </global> <default> <carriers> <xyz_xyzshipping> <active>1</active> <sort_order>10</sort_order> <model>xyz_xyzshipping/carrier</model> <title>Xyz Shipping</title> <sort_order>10</sort_order> </xyz_xyzshipping> </carriers> </default> </config> 解决方法
您需要使用包含sql代码的安装程序脚本.
您可以参考以下链接 http://www.amitbera.com/create-an-magento-extension-with-custom-database-table/ 这是使用自定义表创建基本扩展的教程. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |