Same filename and directory in other branches
- 5.0.x advagg_mod/src/Asset/AsyncJs.php
- 6.0.x advagg_mod/src/Asset/AsyncJs.php
- 8.x-4.x advagg_mod/src/Asset/AsyncJs.php
Namespace
Drupal\advagg_mod\Asset
Fichier
-
advagg_mod/src/Asset/AsyncJs.php
View source
<?php
namespace Drupal\advagg_mod\Asset;
class AsyncJs {
public function async($content) {
$pattern = '/<script src=".*"/';
return preg_replace_callback($pattern, [
$this,
'callback',
], $content);
}
protected function callback(array $matches) {
return "{$matches[0]} async";
}
}
Classes
| Titre |
Deprecated |
Résumé |
| AsyncJs |
|
Add async tag to scripts. |