I currently have the following <preference/>
in one of my di.xml file:
<preference for="Magento\Contact\Controller\Index\Post" type="RadTest\TestModule\Controller\Contact\Post" />
I have an enable/disable configuration option for my module in the admin panel. I only want the <preference>
to be enabled when my custom configuration option is set to enabled.
How can I dynamically enable and disable the <preference/>
overriding according to the configuration of my module is set?