Skip to content

Instantly share code, notes, and snippets.

@vinilios
Created December 3, 2009 13:14
Show Gist options
  • Save vinilios/248144 to your computer and use it in GitHub Desktop.
Save vinilios/248144 to your computer and use it in GitHub Desktop.
symfony 1.0 assets patch
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