Commit c5c0ebc0 authored by Taylor Otwell's avatar Taylor Otwell

allow rel and other stylesheet defaults to be overriden.

parent e366c62d
...@@ -56,9 +56,12 @@ class HTML { ...@@ -56,9 +56,12 @@ class HTML {
*/ */
public static function style($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 '<link href="'.static::entities(URL::to_asset($url)).'"'.static::attributes($attributes).'>'.PHP_EOL; return '<link href="'.static::entities(URL::to_asset($url)).'"'.static::attributes($attributes).'>'.PHP_EOL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment