use TYPO3\CMS\Backend\Utility\BackendUtility; // Generate a link to view a record with UID 123 $link = BackendUtility::getViewOnClick('tx_myextension_domain_model_mymodel', 123); // Output the link in an HTML context echo 'Click here to view the record';
use TYPO3\CMS\Backend\Utility\BackendUtility; // Get the UID of the currently logged-in backend user $uid = BackendUtility::getBackendUser()->getUid(); // Generate a link to view the user record $link = BackendUtility::getViewOnClick('be_users', $uid); // Output the link in an HTML context echo 'Click here to view your profile';In this example, we are using the getBackendUser method to get the UID of the currently logged-in backend user. We then use this UID to generate a link that will open the user record in the "be_users" table. We again output the link in an HTML context. The BackendUtility class is part of the TYPO3 CMS core library.