vjandrea/html

Illuminate/Html 扩展

v1.2.0 2014-08-28 09:53 UTC

This package is not auto-updated.

Last update: 2024-09-14 15:42:05 UTC


README

Build Status

此包为 Laravel 4 的 Illuminate/Html 添加了一些缺失的方法

方法

  • favicon()
  • meta_charset()
  • html()
  • title()
  • h1()
  • h2()
  • h3()
  • h4()
  • h5()
  • h6()
  • heading()
  • iframe()
  • youtube_iframe()
  • vimeo_iframe()
  • video()
  • audio()

安装

添加到 composer.json

"vjandrea/html": "dev-master"

并在 app/config/app.php 中的 'providers' 数组中添加

'Vjandrea\Html\HtmlServiceProvider' 

运行 composer install 并准备好使用此包。

使用方法

favicon

返回指定图像 href 的 favicon 链接

HTML::favicon($href, $type)

参数

string  $href   default ''
string  $type   default 'image/x-icon'

返回值

string

meta_charset

返回 meta charset 标签

HTML::meta_charset($charset)

参数

string  $charset    default 'utf-8'

返回值

string

html

返回带有 lang 参数的 html

HTML::html($lang)

参数

string  $lang   default ''

返回值

string

title

返回 title 标签

HTML::title($title)

参数

string  $title  default ''

返回值

string

h1

返回 h1 标题

HTML::h1($title, $attributes)

参数

string  $title  default ''
array   $attributes default []

返回值

string

h2

返回 h2 标题

HTML::h2($title, $attributes)

参数

string  $title  default ''
array   $attributes default []

返回值

string

h3

返回 h3 标题

HTML::h3($title, $attributes)

参数

string  $title  default ''
array   $attributes default []

返回值

string

h4

返回 h4 标题

HTML::h4($title, $attributes)

参数

string  $title  default ''
array   $attributes default []

返回值

string

h5

返回 h5 标题

HTML::h5($title, $attributes)

参数

string  $title  default ''
array   $attributes default []

返回值

string

h6

返回 h6 标题

HTML::h6($title, $attributes)

参数

string  $title  default ''
array   $attributes default []

返回值

string

heading

返回标题

HTML::heading($type, $title, $attributes)

参数

string  $type   default 'h1'
string  $title  default ''
array   $attributes default []

返回值

string

iframe

返回 <iframe> 标签

HTML::iframe($src, $attributes)

参数

string  $src    default ''
array   $attributes default []

返回值

string

youtube_iframe

返回 YouTube <iframe> 标签 默认设置 frameborder=0 和 allowfullscreen

HTML::youtube_iframe($youtube_id, $attributes, $allow_fullscreen, $frameborder)

参数

string  $youtube_id default ''
array   $attributes default []
boolean $allow_fullscreen   default true
boolean $frameborder    default false (deprecated in HTML5)

返回值

string

vimeo_iframe

返回 Vimeo <iframe> 标签

HTML::vimeo_iframe($vimeo_id, $attributes, $allow_fullscreen, $frameborder, $title, $byline, $portrait)

参数

string  $vimeo_id   default ''
array   $attributes default ''
boolean $allowfullscreen    default true
boolean $frameborder    default false (deprecated in HTML5)
boolean $title  default false (Vimeo option)
boolean $byline default false (Vimeo option)
boolean $portrait   default false (Vimeo option)

返回值

string

video

返回 <video> 标签

HTML::video($src, $attributes)

参数

mixed   $src    default ''

返回值

string

audio

返回 <audio> 标签

HTML::audio($src, $attributes)

参数

mixed   $src    default '' (it may be an array)
array   $attributes default []

返回值

string