Created
December 3, 2009 13:14
-
-
Save vinilios/248144 to your computer and use it in GitHub Desktop.
symfony 1.0 assets patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: lib/helper/AssetHelper.php | |
=================================================================== | |
--- lib/helper/AssetHelper.php (revision 15043) | |
+++ lib/helper/AssetHelper.php (working copy) | |
@@ -159,11 +159,23 @@ | |
$sourceOptions = (func_num_args() > 1 && is_array($sources[func_num_args() - 1])) ? array_pop($sources) : array(); | |
$html = ''; | |
+ | |
+ $before = ''; | |
+ $after = ''; | |
+ | |
+ if (isset($sourceOptions['browser_condition'])) | |
+ { | |
+ $before = '<!--[' . $sourceOptions['browser_condition'] . ']>'."\n"; | |
+ $after = '<![endif]-->'."\n"; | |
+ | |
+ unset($sourceOptions['browser_condition']); | |
+ } | |
+ | |
foreach ($sources as $source) | |
{ | |
$source = stylesheet_path($source); | |
$options = array_merge(array('rel' => 'stylesheet', 'type' => 'text/css', 'media' => 'screen', 'href' => $source), $sourceOptions); | |
- $html .= tag('link', $options)."\n"; | |
+ $html .= $before.tag('link', $options)."\n".$after; | |
} | |
return $html; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment