Source of file PageControllerExtension.php
Size: 0,617 Bytes - Last Modified: 2021-12-24T06:45:20+00:00
/var/www/docs.ssmods.com/process/src/src/PageControllerExtension.php
1234567891011121314151617181920212223 | <?php namespace DorsetDigital\TawkTo; use SilverStripe\Core\Extension; use SilverStripe\SiteConfig\SiteConfig; use SilverStripe\View\Requirements; class PageControllerExtension extends Extension { /** * Add the script to the end of the page if it's in the config * We remove any tags here, since they shouldn't be in the snippet */ public function onAfterInit() { $config = SiteConfig::current_site_config(); if ($config->TawkToEmbedCode != "") { $embed = strip_tags($config->TawkToEmbedCode); Requirements::customScript($embed); } } } |