选择语言 :

 Core_HTML::style

Creates a style sheet link element.

echo HTML::style('media/css/screen.css');
string Core_HTML::style( string $file [, array $attributes = null , boolean $index = bool false ] )
uses
URL::base
HTML::attributes

参数列表

参数 类型 描述 默认值
$file string File name
$attributes array Default attributes null
$index boolean Include the index page bool false
返回值
  • string
File: ./core/classes/html.class.php
public static function style($file, array $attributes = null, $index = false)
{
    if (strpos($file, '://') === false)
    {
        // Add the base URL
        $file = Core::url()->base($index) . $file;
    }
    // Set the stylesheet link
    $attributes['href'] = $file;
    // Set the stylesheet rel
    $attributes['rel'] = 'stylesheet';
    // Set the stylesheet type
    $attributes['type'] = 'text/css';
    return '<link' . HTML::attributes($attributes) . ' />';
}