addCSS

The method $this->addCSS($CSS) adds a reference to a CSS file to be included in the page.

  • @param: (string) $CSS. The relative path to the CSS file.

Example Usage

<?php

namespace Plugins\Myplugin;

use \Typemill\Plugin;

class Myplugin extends Plugin
{
    ...

    public function myFunction()
    {
        $this->addCSS('https://some-url.com/with/path/to/style.css');

        $this->addCSS('/yourpluginfolder/subfolder/style.css');
    }
}

Will be rendered in the template with this template tag:

{{ renderCSS() }} // This tag should be placed in the HTML header.