src/Widget/Injector/HtmlInjector.php
/**
     * insert some HTML before the first CSS include in the page.
     * If there is no CSS anywhere, place it right after start of head.
     */
insert some HTML before the first CSS include in the page.
If there is no CSS anywhere, place it right after start of head.
insert some HTML before the first CSS include in the page . If there is no CSS anywhere place it right after start of head .
protected function cssTagsBefore(string $snippet, string $rawHtml): string
    {
        $result = self::injectBeforeTagStart($rawHtml, 'link', $snippet);
        if ($result === $rawHtml) {
            $result = self::injectBeforeTagStart($rawHtml, 'style', $snippet);
        }
        if ($result === $rawHtml) {
            $result = self::injectAfterTagStart($rawHtml, 'head', $snippet);
        }
        return $result;
    }
protected function cssTagsBefore ( string $ snippet , string $ rawHtml ) : string { $ result = self :: injectBeforeTagStart ( $ rawHtml , 'link' , $ snippet ) ; if ( $ result === $ rawHtml ) { $ result = self :: injectBeforeTagStart ( $ rawHtml , 'style' , $ snippet ) ; } if ( $ result === $ rawHtml ) { $ result = self :: injectAfterTagStart ( $ rawHtml , 'head' , $ snippet ) ; } return $ result ; }
insert some HTML before the first CSS include in the page.
insert some HTML before the first CSS include in the page .