Save contact form data magento module config file

This tutorial explains how to create the config file for creating the magento module for save contact form data to the magento database. Please copy and paste the following code.

Please click here to get the full magento module code which shows the files structure and controller and model file codes.

<?xml version="1.0"?>
<config>
    <modules>
        <Save_Contactform>
            <version>0.1.0</version>
        </Save_Contactform>
    </modules>
    <global>
        <models>
            <contactform>
                <class>Save_Contactform_Model</class>
                <resourceModel>contactform_resource</resourceModel>
            </contactform>
            <contactform_resource>
                <class>Save_Contactform_Model_Resource</class>
                <entities>
                    <contactformsave>
                        <table>contact_table</table>
                    </contactformsave>
                </entities>
            </contactform_resource>
        </models>
        <resources>
            <save_contactform_setup>
                <setup>
                    <module>Save_Contactform</module>
                </setup>
            </save_contactform_setup>
            <save_contactform_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </save_contactform_read>
            <save_contactform_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </save_contactform_write>
        </resources>
    </global>
    <frontend>
        <routers>
            <contactform>
                <use>standard</use>
                <args>
                    <module>Save_Contactform</module>
                    <frontName>contactform</frontName>
                </args>
            </contactform>
        </routers>
    </frontend>
    <global>
        <rewrite>
            <customcontactus>
                <from><![CDATA[#^/contacts/index/#]]></from>
                <to>/contactform/index/</to>
            </customcontactus>
        </rewrite>
    </global>

</config>

Share this Tutorial