Add to

Functions for adding content to the output.


Append content to head.

RobiNN\UiKit\AddTo::head('<meta ...>');

Is also possible to set order by setting before or after as second argument (after is default).

before - these tags will be added first.

after - these tags will be added after tags with before set.

In this example, main.css will be loaded first and custom.css will be loaded second. If the order is not specified, it will be loaded as it's called, custom.css first and main.css second.

RobiNN\UiKit\AddTo::head('<link href="custom.css" rel="stylesheet">', 'after');
RobiNN\UiKit\AddTo::head('<link href="main.css" rel="stylesheet">', 'before');

Append content to footer.

Is also possible to set order by setting before orafter as second argument (after is default).

before - these tags will be added first.

after - these tags will be added after tags with before set.

RobiNN\UiKit\AddTo::footer('<script>...</script>');

js()

Add JS code to the output. It's loaded in the footer.

RobiNN\UiKit\AddTo::js('let uikit = "";');

css()

Add CSS code to the output.

RobiNN\UiKit\AddTo::css('body { color: #000; }');

getHeadTags()

Get all head tags.

If you have a custom layout, load this method to get UI Kit tags.

$head_tags = RobiNN\UiKit\AddTo::getHeadTags();

getFooterTags()

Get all footer tags.

If you have a custom layout, load this method to get UI Kit tags.

$footer_tags = RobiNN\UiKit\AddTo::getFooterTags();