亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

directory search
Array Array Helper Benchmarking Benchmarking Class Caching Caching Driver Calendaring Calendaring Class CAPTCHA CAPTCHA Helper Config Config Class Cookie Cookie Helper Database Connecting to your Database Custom Function Calls Database Caching Class Database Configuration Database Forge Class Database Metadata Database Quick Start: Example Code Database Reference Database Utility Class DB Driver Reference Generating Query Results Queries Query Builder Class Query Helper Methods Transactions Date Date Helper Directory Directory Helper Download Download Helper Email Email Class Email Helper Encrypt Encrypt Class Encryption Encryption Library File File Helper File Uploading File Uploading Class Form Form Helper Form Validation Form Validation FTP FTP Class Functions compatibility_functions common_functions HTML HTML Helper HTML Table HTML Table Class Image Manipulation Image Manipulation Class Inflector Inflector Helper Input Input Class Javascript Javascript Class Language Language Class Language Helper Loader Loader Class Migrations Migrations Class Number Number Helper Output Output Class Pagination Pagination Class Path Path Helper Security Security Class Security Helper Session Session Library Shopping Cart Shopping Cart Class Smiley Smiley Helper String String Helper Template Parser Template Parser Class Text Text Helper Trackback Trackback Class Typography Typography Class Typography Helper Unit Testing Unit Testing Class URI URL User Agent XML XML-RPC and XML-RPC Server Zip Encoding Zip Encoding Class XML-RPC and XML-RPC Server Classes XML Helper User Agent Class URL Helper URI Class
characters

HTMLHelper文件包含有助于使用HTML的功能。

  • 加載此助手

  • 可用職能

加載此助手

使用以下代碼加載此助手:

$this->load->helper('html');

可用職能

現(xiàn)有下列職能:

heading([$data = ''[, $h = '1'[, $attributes = '']]])

參數(shù):

$ data(string) -  Content $ h(string) - 標題級別$ attributes(混合) -  HTML屬性

返回:

HTML標題標簽

返回類型:

  • $ datastring) - 內(nèi)容

  • $ h字符串) - 標題級別

  • $ attributesmixed) -  HTML屬性

Returns:  HTML heading tag
Return type:  string
讓您創(chuàng)建HTML標題標簽。第一個參數(shù)將包含數(shù)據(jù),第二個參數(shù)將包含標題的大小。例:

echo heading('Welcome!', 3);

以上將產(chǎn)生:<h3>歡迎%21</h3>

此外,為了向標題標記添加屬性,如HTML類、ID或內(nèi)聯(lián)樣式,第三個參數(shù)接受字符串或數(shù)組:

回聲標題('Welcome!',3,'class =“pink”'); echo'heading('你好嗎?',4,array('id'=>'question','class'=>'green'));

上述代碼產(chǎn)生:

<h3 class="pink">Welcome!<h3> <h4 id="question" class="green">How are you?</h4>

img([$src = ''[, $index_page = FALSE[, $attributes = '']]])

參數(shù):

$ src(string) - 圖片源數(shù)據(jù)$ index_page(bool) - 是否將$ src視為路由URI字符串$ attributes(array) -  HTML屬性

返回:

HTML圖片標簽

返回類型:

  • $ src字符串) - 圖像源數(shù)據(jù)

  • $ index_pagebool) - 是否將$ src視為路由URI字符串

  • $ attributesarray) -  HTML屬性

Returns:  HTML image tag
Return type:  string
讓您創(chuàng)建HTML <img />標簽。第一個參數(shù)包含圖像源。例:

echo img('images / picture.jpg'); //給出<img src =“http://site.com/images/picture.jpg”/>

有一個可選的第二個參數(shù),它是一個true/false值,它指定SRC應該有指定的頁面。$config['index_page']添加到它創(chuàng)建的地址中。如果您使用的是媒體控制器,那么大概是這樣的:

echo img('images / picture.jpg',TRUE); //給出<img src =“http://site.com/index.php/images/picture.jpg”alt =“”/>

此外,可以將關聯(lián)數(shù)組傳遞給img()函數(shù),以完全控制所有屬性和值。如果未提供alt屬性,則CodeIgniter將生成一個空字符串。

例子:

$image_properties = array(         'src'   => 'images/picture.jpg',         'alt'   => 'Me, demonstrating how to eat 4 slices of pizza at one time',         'class' => 'post_images',         'width' => '200',         'height'=> '200',         'title' => 'That was quite a night',         'rel'   => 'lightbox' );  img($image_properties); // <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post\_images" width="200" height="200" title="That was quite a night" rel="lightbox" />

link_tag([$href = ''[, $rel = 'stylesheet'[, $type = 'text/css'[, $title = ''[, $media = ''[, $index_page = FALSE]]]]]])

參數(shù):

$ href(string) - 我們鏈接到$ rel(string)的什么 - 關系類型$ type(string) - 相關文檔的類型$ title(string) - 鏈接標題$ media(string) - 介質(zhì)類型$ index_page(bool ) - 是否將$ src視為路由URI字符串

返回:

HTML鏈接標記

返回類型:

  • $ hrefstring) - 我們鏈接到的是什么

  • $ rel字符串) - 關系類型

  • $ typestring) - 相關文檔的類型

  • $ titlestring) - 鏈接標題

  • $ media字符串) - 媒體類型

  • $ index_pagebool) - 是否將$ src視為路由URI字符串

Returns:  HTML link tag
Return type:  string
Lets you create HTML <link /> tags. This is useful for stylesheet links, as well as other links. The parameters are _href_, with optional _rel_, _type_, _title_, _media_ and _index\_page_.

index_page是一個布爾值,用于指定href是否應該將通過$config['index_page']添加指定的頁面添加到它創(chuàng)建的地址。

例子:

echo link_tag('css / mystyles.css'); //給出<link href =“http://site.com/css/mystyles.css”rel =“stylesheet”type =“text / css”/>

其他例子:

echo link_tag('favicon.ico','快捷圖標','image / ico'); // <link href =“http://site.com/favicon.ico”rel =“shortcut icon”type =“image / ico”/> echo link_tag('feed','alternate','application / rss + xml','我的RSS Feed'); // <link href =“http://site.com/feed”rel =“alternate”type =“application / rss + xml”title =“My RSS Feed”/>

此外,可以將關聯(lián)數(shù)組傳遞給link()函數(shù),用于對所有屬性和值進行完全控制:

$link=Array%28%27 href%27=>%27 css/printer.css%27,%27 rel%27=>%27樣式表%27,%27 type%27=>%27 text/css%27,%27media%27=%27打印%27%29;echo鏈接[醫(yī)]標簽%28$link%29;//<link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" />

ul($list[, $attributes = ''])

參數(shù):

$ list(array) - 列出條目$ attributes(array) -  HTML屬性

返回:

HTML格式的無序列表

返回類型:

  • $ listarray) - 列出條目

  • $ attributesarray) -  HTML屬性

Returns:  HTML-formatted unordered list
Return type:  string
Permits you to generate unordered HTML lists from simple or multi-dimensional arrays. Example:

$ list = array('red','blue','green','yellow'); $ attributes = array('class'=>'boldlist','id'=>'mylist'); echo ul($ list,$ attributes);

上述代碼將產(chǎn)生以下結果:

<ul class="boldlist" id="mylist">         <li>red</li>         <li>blue</li>         <li>green</li>         <li>yellow</li> </ul>

下面是一個更復雜的示例,使用多維數(shù)組:

$ attributes = array('class'=>'boldlist','id'=>'mylist'); $ list = array('colors'=> array('red','blue','green'),'shapes'=> array('round','square','circles'=> array('ellipse' ''''),'心情'=>數(shù)組('happy','upset'=> array('defeated'=> array('dejected','        'disheartened',                                 'depressed'                         ),                         'annoyed',  ))); echo ul($ list,$ attributes);

上述代碼將產(chǎn)生以下結果:

<ul class="boldlist" id="mylist">         <li>colors                 <ul>                         <li>red</li>                         <li>blue</li>                         <li>green</li>                 </ul>         </li>         <li>shapes                 <ul>                         <li>round</li>                         <li>suare</li>                         <li>circles                                 <ul>                                         <li>elipse</li>                                         <li>oval</li>                                         <li>sphere</li>                                 </ul>                         </li>                 </ul>         </li>         <li>moods                 <ul>                         <li>happy</li>                         <li>upset                                 <ul>                                         <li>defeated                                                 <ul>                                                         <li>dejected</li>                                                         <li>disheartened</li>                                                         <li>depressed</li>                                                 </ul>                                         </li>                                         <li>annoyed</li>                                         <li>cross</li>                                         <li>angry</li>                                 </ul>                         </li>                 </ul>         </li> </ul>

ol($list, $attributes = '')

參數(shù):

$ list(array) - 列出條目$ attributes(array) -  HTML屬性

返回:

HTML格式的有序列表

返回類型:

  • $ listarray) - 列出條目

  • $ attributesarray) -  HTML屬性

Returns:  HTML-formatted ordered list
Return type:  string
Identical to [`ul()`](about:blank#ul), only it produces the <ol> tag for ordered lists instead of <ul>.

meta([$name = ''[, $content = ''[, $type = 'name'[, $newline = "n"]]]])

參數(shù):

$ name(字符串) - 元名稱$ content(字符串) - 元內(nèi)容$ type(字符串) - 元類型$ newline(字符串) - 換行符

返回:

HTML元標記

返回類型:

  • $ name字符串) - 元名稱

  • $ content字符串) - 元內(nèi)容

  • $ typestring) - 元類型

  • $ newlinestring) - 換行符

Returns:  HTML meta tag
Return type:  string
幫助您生成元標記。您可以將字符串傳遞給該函數(shù),或簡單數(shù)組或多維數(shù)組。

例子:

echo meta('description', 'My Great site'); // Generates:  <meta name="description" content="My Great Site" />  echo meta('Content-type', 'text/html; charset=utf-8', 'equiv'); // Note the third parameter.  Can be "equiv" or "name" // Generates:  <meta http-equiv="Content-type" content="text/html; charset=utf-8" />  echo meta(array('name' => 'robots', 'content' => 'no-cache')); // Generates:  <meta name="robots" content="no-cache" />  $meta = array(         array(                 'name' => 'robots',                 'content' => 'no-cache'         ),         array(                 'name' => 'description',                 'content' => 'My Great Site'         ),         array(                 'name' => 'keywords',                 'content' => 'love, passion, intrigue, deception'         ),         array(                 'name' => 'robots',                 'content' => 'no-cache'         ),         array(                 'name' => 'Content-type',                 'content' => 'text/html; charset=utf-8', 'type' => 'equiv'         ) );  echo meta($meta); // Generates: // <meta name="robots" content="no-cache" /> // <meta name="description" content="My Great Site" /> // <meta name="keywords" content="love, passion, intrigue, deception" /> // <meta name="robots" content="no-cache" /> // <meta http-equiv="Content-type" content="text/html; charset=utf-8" />

doctype([$type = 'xhtml1-strict'])

參數(shù):

$ type(字符串) -  Doctype名稱

返回:

HTML DocType標簽

返回類型:

  • $ type字符串) – Doctype name   Returns:  HTML DocType tag    Return type:  string    Helps you generate document type declarations, or DTD’s. XHTML 1.0 Strict is used by default, but many doctypes are available. Example: echo doctype(); // <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  echo doctype('html4-trans'); // <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">  The following is a list of doctype choices. These are configurable, and pulled from application/config/doctypes.php    Document type Option Result    XHTML 1.1 xhtml11 <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “[http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd](https://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd)“>   XHTML 1.0 Strict xhtml1-strict <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “[http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd](https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd)“>   XHTML 1.0 Transitional xhtml1-trans <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd](https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd)“>   XHTML 1.0 Frameset xhtml1-frame <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Frameset//EN” “[http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd](https://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd)“>   XHTML Basic 1.1 xhtml-basic11 <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML Basic 1.1//EN” “[http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd](https://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd)“>   HTML 5 html5 <!DOCTYPE html>   HTML 4 Strict html4-strict <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “[http://www.w3.org/TR/html4/strict.dtd](https://www.w3.org/TR/html4/strict.dtd)“>   HTML 4 Transitional html4-trans <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “[http://www.w3.org/TR/html4/loose.dtd](https://www.w3.org/TR/html4/loose.dtd)“>   HTML 4 Frameset html4-frame <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Frameset//EN” “[http://www.w3.org/TR/html4/frameset.dtd](https://www.w3.org/TR/html4/frameset.dtd)“>   MathML 1.01 mathml1 <!DOCTYPE math SYSTEM “[http://www.w3.org/Math/DTD/mathml1/mathml.dtd](https://www.w3.org/Math/DTD/mathml1/mathml.dtd)“>   MathML 2.0 mathml2 <!DOCTYPE math PUBLIC “-//W3C//DTD MathML 2.0//EN” “[http://www.w3.org/Math/DTD/mathml2/mathml2.dtd](https://www.w3.org/Math/DTD/mathml2/mathml2.dtd)“>   SVG 1.0 svg10 <!DOCTYPE svg PUBLIC “-//W3C//DTD SVG 1.0//EN” “[http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd](https://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd)“>   SVG 1.1 Full svg11 <!DOCTYPE svg PUBLIC “-//W3C//DTD SVG 1.1//EN” “[http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd](https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd)“>   SVG 1.1 Basic svg11-basic <!DOCTYPE svg PUBLIC “-//W3C//DTD SVG 1.1 Basic//EN” “[http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd](https://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd)“>   SVG 1.1 Tiny svg11-tiny <!DOCTYPE svg PUBLIC “-//W3C//DTD SVG 1.1 Tiny//EN” “[http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd](https://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd)“>   XHTML+MathML+SVG (XHTML host) xhtml-math-svg-xh <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN” “[http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd](https://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd)“>   XHTML+MathML+SVG (SVG host) xhtml-math-svg-sh <!DOCTYPE svg:svg PUBLIC “-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN” “http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd”>   XHTML+RDFa 1.0 xhtml-rdfa-1 <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML+RDFa 1.0//EN” “[http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd](https://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd)“>   XHTML+RDFa 1.1 xhtml-rdfa-2 <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML+RDFa 1.1//EN” “[http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd](https://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd)“>   br([$count = 1])參數(shù):$ count(int) - 重復tagReturns的次數(shù):HTML換行符tagReturn類型:string

  • $ countint) - 重復標簽的次數(shù)

Returns:  HTML line break tag
Return type:  string
Generates line break tags (<br />) based on the number you submit. Example:

回聲br(3);

以上將產(chǎn)生:

<br /><br /><br />

這一功能已被廢棄。使用本機str_repeat()結合在一起<br />相反。

nbs([$num = 1])

參數(shù):

$ num(int) - 要生成的空間實體的數(shù)量

返回:

一系列不間斷的空間HTML實體

返回類型:

  • $ numint) - 要生成的空間實體的數(shù)量

Returns:  A sequence of non-breaking space HTML entities
Return type:  string
Generates non-breaking spaces (&nbsp;) based on the number you submit. Example:

echonbs(3);

以上將產(chǎn)生:

這個功能是DEPRECATED。str_repeat()結合使用本地和&nbsp;替代。

Previous article: Next article: