Same name in other branches
- 6.0.x advagg_mod/src/Asset/DeferCss.php \Drupal\advagg_mod\Asset\DeferCss::inlineScript()
- 8.x-3.x advagg_mod/src/Asset/DeferCss.php \Drupal\advagg_mod\Asset\DeferCss::inlineScript()
- 8.x-4.x advagg_mod/src/Asset/DeferCss.php \Drupal\advagg_mod\Asset\DeferCss::inlineScript()
Callback to replace the script link with an inline script.
Parameters
array $matches: Array from matches from preg_replace_callback.
Return value
string Updated html string.
File
-
advagg_mod/
src/ Asset/ DeferCss.php, line 103
Class
- DeferCss
- Modify stylesheet links to defer them. May lead to Flash of unstyled content.
Namespace
Drupal\advagg_mod\AssetCode
protected function inlineScript(array $matches) {
$data = @file_get_contents($matches[1]);
return "<script>{$data}";
}