Skip to content
This repository has been archived by the owner on Jun 2, 2018. It is now read-only.

Commit

Permalink
Option to return style filename, not HTML tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Oreolek committed Feb 21, 2014
1 parent aaffc1b commit 19e6149
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions classes/Less/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ class Less_Core
* @param mixed array of css paths or single path
* @param string value of media css type
* @param boolean allow compression
* @param boolean return HTML style tag or file paths
* @return string link tag pointing to the css paths
* @return array array of css paths
*/
public static function compile($array = '', $media = 'screen')
public static function compile($array = '', $media = 'screen', $html = TRUE)
{
if (is_string($array))
{
Expand Down Expand Up @@ -64,10 +66,25 @@ public static function compile($array = '', $media = 'screen')
foreach ($stylesheets as $file)
{
$filename = self::_get_filename($file, $config['path']);
array_push($assets, HTML::style($filename, array('media' => $media)));
if ($html)
{
$style = HTML::style($filename, array('media' => $media));
}
else
{
$style = $filename;
}
array_push($assets, $style);
}

return implode("\n", $assets);
if ($html)
{
return implode("\n", $assets);
}
else
{
return $assets;
}
}

/**
Expand Down

0 comments on commit 19e6149

Please sign in to comment.