src/Widget/Injector/HtmlInjector.php
/**
     * insert some HTML into the head section of an HTML page.
     * If there is no CSS anywhere, place it right before end of head.
     */
insert some HTML into the head section of an HTML page.
If there is no CSS anywhere, place it right before end of head.
insert some HTML into the head section of an HTML page . If there is no CSS anywhere place it right before end of head .
protected function cssTagsAfter(string $snippet, string $rawHtml): string
    {
        $result = self::injectAfterTagEnd($rawHtml, 'link', $snippet);
        if ($result === $rawHtml) {
            $result = self::injectAfterTagEnd($rawHtml, 'style', $snippet);
        }
        if ($result === $rawHtml) {
            $result = self::injectBeforeTagEnd($rawHtml, 'head', $snippet);
        }
        return $result;
    }
protected function cssTagsAfter ( string $ snippet , string $ rawHtml ) : string { $ result = self :: injectAfterTagEnd ( $ rawHtml , 'link' , $ snippet ) ; if ( $ result === $ rawHtml ) { $ result = self :: injectAfterTagEnd ( $ rawHtml , 'style' , $ snippet ) ; } if ( $ result === $ rawHtml ) { $ result = self :: injectBeforeTagEnd ( $ rawHtml , 'head' , $ snippet ) ; } return $ result ; }
insert some HTML into the head section of an HTML page.
insert some HTML into the head section of an HTML page .