requireCss()

Description

Lets you include external CSS files without having to write tags. It works like PHP's include_once, making sure that a single file is never included more than once.

Usage

<?php 
    echo requireCss( $file, [$global] ); 
?>

Parameters

$file

  • required
  • string

The URL to the file (can be relative or absolute, but best with absolute)

$global

  • optional
  • true or false
  • default is false

If true, the function will look for the file in the ../site/css folder.

Examples

Include an extra CSS file (not main.css) from theme folder

<?php 
    echo requireCss( themeUrl() . "css/print.css" ); 
?>