public function style($assets, $name, $path = "", $cache = 0, $version = false)
{
$path = $this->path($path);
if (!$path) {
return null;
}
$href = rtrim($this->pathToUrl($path), '/') . "/{$name}.css" . ($version ? "?ver={$version}" : "");
$path .= "/{$name}.css";
$tag = '<link href="' . $href . '" type="text/css" rel="stylesheet" />' . "\n";
if ($cache && file_exists($path) && time() - filemtime($path) < $cache) {
return $tag;
}
$result = $this->compile($assets, "css");
if ($result) {
file_put_contents($path, $result);
return $tag;
}
return null;
}