TYPO3 TCA execute hook after object save in backend

前端 未结 1 434
悲&欢浪女
悲&欢浪女 2021-01-13 23:13

I want to manipulate some values and execute a custom function if an object is saved trought the backend. I found through my google search that I have to specify this in my

相关标签:
1条回答
  • 2021-01-14 00:04

    Register your hook class in local configuration (ext_localconf.php):

    $GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][''] = 'NXS\\NxsReferenzen\\Hook\\TCEmainHook';
    $GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][''] = 'NXS\\NxsReferenzen\\Hook\\TCEmainHook';
    

    Ensure your hook class has namespace declaration:

    <?php
    namespace NXS\NxsReferenzen\Hook;
    
    class TCEmainHook {
        public function processCmdmap_postProcess($command, $table, $id, $value, \TYPO3\CMS\Core\DataHandling\DataHandler &$pObj) {
            echo '<pre>';
            var_dump($command);
            echo '<pre>';
            die();
        }
    }
    
    0 讨论(0)
提交回复
热议问题