From 19e61497e200316d66be75ae8ae0b2074761769b Mon Sep 17 00:00:00 2001 From: Oreolek Date: Fri, 21 Feb 2014 13:51:53 +0700 Subject: [PATCH] Option to return style filename, not HTML tag --- classes/Less/Core.php | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/classes/Less/Core.php b/classes/Less/Core.php index d5a077c..f08a4ad 100644 --- a/classes/Less/Core.php +++ b/classes/Less/Core.php @@ -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)) { @@ -64,10 +66,25 @@ class Less_Core 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; + } } /**