PHP code example of t3g / usercentrics

1. Go to this page and download the library: Download t3g/usercentrics library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

t3g / usercentrics example snippets


$dataProcessingService = 'My Data Processing Service';
$attributes = [
    'type' => 'text/plain',
    'data-usercentrics' => $dataProcessingService,
];
$assetCollector = GeneralUtility::makeInstance(AssetCollector::class);
$assetCollector->addJavaScript(
    'my-ext-scripts',
    'EXT:site/Resources/Public/JavaScript/Scripts.js',
    $attributes
);