Define an internal stylesheet?

I know about $view->registerCSSFile() to register an external style sheet, but is there a way to include an internal style sheet, to insert a <style> tag and contents inside the <head>? I want to define a style that I only need for one page, so putting it in an external file feels like overkill. I can’t find any examples of this, except perhaps view blocks? Thanks in advance.

Use $view->registerCss($content). It creates a <style> tag in the <head> with $content as the CSS.

1 Like

Thanks! Sorry I missed that in the documentation.