You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-05 12:32:55 +01:00
update session listener inject javascript before html tag instead of body
This commit is contained in:
@@ -73,7 +73,7 @@ final class SessionListener implements EventSubscriberInterface
|
||||
}
|
||||
|
||||
$content = $response->getContent();
|
||||
|
||||
//dd($content);
|
||||
$html = '';
|
||||
|
||||
foreach ($rendereResponse['scripts'] as $script) {
|
||||
@@ -94,7 +94,7 @@ if ("undefined" === typeof PHPFlasher) {
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
$pos = strripos($content, '</body>');
|
||||
$pos = strripos($content, '</html>');
|
||||
$content = substr($content, 0, $pos).$html.substr($content, $pos);
|
||||
$response->setContent($content);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user