1

The definition of function says it further checks the method _saveVendorModule in the current class ($this) for custom logic.

Does anyone has used this before to add or override some logic?

/**
 * Custom save logic for section
 *
 * @return void
 */
protected function _saveSection()
{
    $method = '_save' . $this->string->upperCaseWords($this->getRequest()->getParam('section'), '_', '');
    print_r( $method );  //This will print _saveVendorModule
    if (method_exists($this, $method)) {
        $this->{$method}();
    }
}

system.xml

<?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
        <system>
            <tab id="vendor_module" translate="label" sortOrder="10">
                <label>Vendor Name</label>
            </tab>
            <section id="module" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
                <class>separator-top</class>
                <label>General</label>
                <tab>vendor</tab>
                <resource>Vendor_Module::dimension_configuration</resource>
                <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>General</label>                 
                    <field id="dimension" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                        <label>Dimension Text</label>
                        <comment>Dimension Text will display on the storefront.</comment>
                        <backend_model>Vendor\Module\Model\Config\Backend\Dimension</backend_model>
                    </field>
                </group>
            </section>
        </system>
    </config>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.