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

语言帮助文件包含有助于处理语言文件的功能。

  • 加载此助手

  • 可用职能

加载此助手

使用以下代码加载此助手:

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

可用职能

现有下列职能:

lang($line[, $for = ''[, $attributes = array()]])

参数:

$ line(string) - 语言行键$ for(string) -  HTML“for”属性(我们创建标签的元素的ID)$ attributes(array) - 任何额外的HTML属性

返回:

语言行; 在HTML标签标签中,如果$ for参数不为空

返回类型:

  • $ linestring) - 语言行键

  • $ forstring) -  HTML“for”属性(我们创建标签的元素的ID)

  • $ attributesarray) - 任何额外的HTML属性

Returns:  The language line; in an HTML label tag, if the `$for` parameter is not empty
Return type:  string
这个函数从一个加载的语言文件中返回一行文本,其简单的语法可能比`CI_Lang :: line()`更适合查看文件。

例子:

echo lang('language_key'); //输出:语言行echo('language_key','form_item_id',array('class'=>'myClass')); //输出:<label for =“form \ _item \ _id”class =“myClass”>语言行</ label>

Previous article: Next article: