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>');
Add JS code to the output. It's loaded in the footer.
RobiNN\UiKit\AddTo::js('let uikit = "";');
Add CSS code to the output.
RobiNN\UiKit\AddTo::css('body { color: #000; }');
Get all head tags.
If you have a custom layout, load this method to get UI Kit tags.
$head_tags = RobiNN\UiKit\AddTo::getHeadTags();
Get all footer tags.
If you have a custom layout, load this method to get UI Kit tags.
$footer_tags = RobiNN\UiKit\AddTo::getFooterTags();