PHP code example of tomkyle / dsgvo-twig

1. Go to this page and download the library: Download tomkyle/dsgvo-twig 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/ */

    

tomkyle / dsgvo-twig example snippets



// The path where Composer installs this package
$dsgvo_templates_path = 'vendor/tomkyle/dsgvo-twig/templates';

// Instantiate Loader
$loader = new Twig_Loader_Filesystem([
	'my_templates',
	$dsgvo_templates_path
]);

// Alternatively, add DSGVO templates after instantiation
$loader = ...
$loader->addPath( $dsgvo_templates_path );


echo $twig->render('dsgvo.intro.twig', [
	'company' => 'The ACME Company',
	
	// optional
	'company_shortname' => 'ACME'
]);


echo $twig->render('dsgvo.resonsible.twig', [
	'website_name' => 'www.test.com',
	'email'    => '[email protected]',
	
	// optional:
	'company'      => 'MUSTER-Firma GmbH',
	'address'  => 'Musterstrasse 5',
	'zip'      => '99999',
	'city'     => 'Musterstadt',
	'phone'    => '+4940123456789',
    'title'         => 'Verantwortlicher und Geltungsbereich',
    'website_realm' => 'das Internetangebot',
	'law_name'      => 'EU-Datenschutz-Grundverordnung',
	'law_shortname' => 'DSGVO',
	'company_shortname' => 'MUSTER',
	'region'        => 'Schleswig-Holstein',
	'country'       => 'Deutschland',
	'phone_display' => '+49 (040) 12345678-9',
	'fax_display'   => '+49 (040) 12345678-1'
]);


echo $twig->render('dsgvo.dpo.twig', [
	'external' => true,
	'name'     => 'John Doe',
	'address'  => 'Musterstrasse 5',
	'zip'      => '99999',
	'city'     => 'Musterstadt',
	'phone'    => '+4940123456789',
	'email'    => '[email protected]',
	
	// optional:
	'jobtitle' => 'Zertifiziert als Datenschutzbeauftragter',
	'company'  => 'The External DPO Comp.',
	'region'   => 'Schleswig-Holstein',
	'country'  => 'Deutschland',
	'phone_display' => '+49 (040) 12345678-9',
	'fax_display'   => '+49 (040) 12345678-1'
]);


echo $twig->render('dsgvo.rights.twig');


echo $twig->render('dsgvo.contact.twig', [
	'contactform' => true        
]);


echo $twig->render('dsgvo.https.twig');


echo $twig->render('dsgvo.cookies.twig');


echo $twig->render('dsgvo.links.twig');


echo $twig->render('dsgvo.google-recaptcha.twig', [
	// optional:
	'google_policy_url' => 'https://www.google.de/intl/de/policies/privacy/',
	'legal_basis'        => 'Art.&thinsp;6&nbsp;Abs.&thinsp;1&nbsp;lit.&thinsp;b,c&nbsp;DSGVO'
]);


echo $twig->render('dsgvo.webfonts-typekit.twig', [
	// optional:
	'typekit_policy_url' => 'https://www.adobe.com/de/privacy/policies/typekit.html',
	'typekit_url'        => 'https://typekit.com',
	'legal_basis'        => 'Art.&thinsp;6&nbsp;Abs.&thinsp;1&nbsp;lit.&thinsp;f&nbsp;DSGVO'
]);


echo $twig->render('dsgvo.videos-youtube.twig', [
	// optional:
	'google_policy_url' => 'https://www.google.de/intl/de/policies/privacy/'
]);


echo $twig->render('dsgvo.changes.twig');