选择语言 :

 Core_HTML::script

Creates a script link.

echo HTML::script('media/js/jquery.min.js');
string Core_HTML::script( 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 script($file, array $attributes = null, $index = false)
{
    if (strpos($file, '://') === false)
    {
        // Add the base URL
        $file = Core::url()->base($index) . $file;
    }
    // Set the script link
    $attributes['src'] = $file;
    // Set the script type
    $attributes['type'] = 'text/javascript';
    return '<script' . HTML::attributes($attributes) . '></script>';
}