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 |
返回值
File: ./core/classes/html.class.php
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | public static function style( $file , array $attributes = null, $index = false)
{
if ( strpos ( $file , '://' ) === false)
{
$file = Core::url()->base( $index ) . $file ;
}
$attributes [ 'href' ] = $file ;
$attributes [ 'rel' ] = 'stylesheet' ;
$attributes [ 'type' ] = 'text/css' ;
return '<link' . HTML::attributes( $attributes ) . ' />' ;
}
|