use TYPO3\CMS\Backend\Utility\BackendUtility; // Get the URL token for a backend module action $moduleToken = BackendUtility::getUrlToken('myModule', 'myAction'); // Add the token to the URL params $params = array( 'foo' => 'bar', 'token' => $moduleToken ); $url = BackendUtility::getModuleUrl('myModule', $params);
use TYPO3\CMS\Backend\Utility\BackendUtility; // Get the URL token for a custom backend action $customToken = BackendUtility::getUrlToken('', 'myCustomAction'); // Add the token to the URL params $params = array( 'foo' => 'bar', 'token' => $customToken ); $url = BackendUtility::getAjaxUrl('myExtension', $params);This example generates a tokenized URL for a custom backend action called "myCustomAction". The generated token is added to the URL parameters along with other values. The package library for this function is "TYPO3\CMS\Backend\Utility\BackendUtility".