You are here

public function InstapageCmsPluginLPAjaxLoaderController::injectScript in Instapage plugin 8.3

Same name and namespace in other branches
  1. 7.3 core/modules/lpAjaxLoader/InstapageCmsPluginLPAjaxLoaderController.php \InstapageCmsPluginLPAjaxLoaderController::injectScript()

Inject loading script. This script is responsible for base64 encoding query to it is not altered/stripped by custom caching layers (as Pantheon for example does)

Parameters

$html string Whole landing page html:

Return value

string

File

core/modules/lpAjaxLoader/InstapageCmsPluginLPAjaxLoaderController.php, line 66

Class

InstapageCmsPluginLPAjaxLoaderController
Class InstapageCmsPluginLPAjaxLoaderController

Code

public function injectScript($html) {
  $headTag = '<head>';
  $scriptTag = $this
    ->getView();
  return str_replace($headTag, $headTag . $scriptTag, $html);
}