allow rel and other stylesheet defaults to be overriden.
This commit is contained in:
parent
e366c62db1
commit
c5c0ebc00a
|
@ -56,9 +56,12 @@ public static function script($url, $attributes = array())
|
||||||
*/
|
*/
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue