From c5c0ebc00a37e94134b920c9ed17dc7cfa678710 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 8 Oct 2011 19:55:57 -0500 Subject: [PATCH] allow rel and other stylesheet defaults to be overriden. --- laravel/html.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/laravel/html.php b/laravel/html.php index 5a8aa7bc..731cf66a 100644 --- a/laravel/html.php +++ b/laravel/html.php @@ -56,9 +56,12 @@ public static function script($url, $attributes = array()) */ public static function style($url, $attributes = array()) { - if ( ! array_key_exists('media', $attributes)) $attributes['media'] = 'all'; + $defaults = array('media' => 'all', 'type' => 'text/css', 'rel' => 'stylesheet'); - $attributes = array_merge($attributes, array('rel' => 'stylesheet', 'type' => 'text/css')); + foreach ($defaults as $attribute => $default) + { + if ( ! array_key_exists($attribute, $attributes)) $attributes[$attribute] = $default; + } return ''.PHP_EOL; }