云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > joomla - class - 5

joomla - class - 5

  • 62 次阅读
  • 3 次下载
  • 2025/6/22 22:40:30

Haskey()

意义: 是否有关键字

语法: boolean hasKey (key $key) key $key: The key to check 实际应用:

jimport('joomla.language.language'); $temp =& new jlanguage;

$tem = $temp->haskey('en-GB'); print_r($tem);

结果: True, if the key exists

Load()

意义: 对现有的字符串装载一个唯一语言文件和添加结果

语法: boolean load ([string $extension = 'joomla'], [string $basePath = JPATH_BASE], [string $lang = null], [boolean $reload = false]) string $extension: The extension for which a language file should be loaded string $basePath: The basepath to use string $lang: The language to load, default null for the current language boolean $reload: Flag that will force a language to be reloaded if set to true 实际应用:

jimport('joomla.language.language'); $temp =& new jlanguage; $tem = $temp->load(); print_r($tem);

结果: True, if the file has successfully loaded.

JRegistry API Package Home Joomla.Framework $tem = $temp->getwincp(); print_r($tem); 结果: iso-8859-1

Method __construct getNameSpaces getValue loadArray loadFile loadINI loadObject loadXML makeNameSpace Merge setValue toArray toObject toString __clone Description 构造函数 得到namespaces列表 得到注册值 装载数组到默认的namespace 装载文件目录 装载INI 串到注册的namespace 装载对象的公共变量到默认的namespace 装载 XML 串到注册的namespace 创建一个namespace 合并一个JRegistry对象到一个 设置注册值 翻译一个namespace到一个数组 翻译一个namespace到一个对象 在一个给定的字符格式得到namespace

getNameSpaces()

意义: 得到namespaces列表 语法: array getNameSpaces () 实际应用:

jimport('joomla.registry.registry'); $temp =& new jregistry;

$tem = $temp->getnamespaces(); echo $tem;

getValue()

意义: 得到注册值

语法: mixed getValue (string $regpath, [mixed $default = null]) string $regpath: Registry path (e.g. joomla.content.showauthor) mixed $default: Optional default value 实际应用:

jimport('joomla.registry.registry'); $temp =& new jregistry;

$temp->setValue('joomla.content.showauthor',true); $temp->setValue('joomla.debug',false);

$temp->setValue('joomla.limit',25);

$tem = $temp->getValue('joomla.content.showauthor'); print_r($tem);

loadArray()

意义: 装载数组到默认的namespace

语法: boolean loadArray (array $array, [ $namespace = null], string $namepsace) array $array: Associative array of value to load string $namepsace: The name of the namespace $namespace 实际应用:

jimport('joomla.registry.registry'); $temp =& new jregistry;

$file = array('showauthor'=>true,'showmail'=>false,'listitem'=>30); if($temp->loadArray($file)) echo \

loadFile()

意义: 装载文件目录

语法: boolean loadFile (string $file, [string $format = 'INI'], [string $namespace = null]) string $file: Path to file to load string $format: Format of the file [optional: defaults to INI] string $namespace: Namespace to load the INI string into [optional] 实际应用:

jimport('joomla.registry.registry'); $temp =& new jregistry;

$file = (JPATH_SITE.DS.'language'.DS.'en-GB'.DS.'en-GB.ini'); if($temp->loadfile($file)) echo 'loaded';

loadINI()

意义装载INI 串到注册的namespace:

语法: boolean loadINI (string $data, [string $namespace = null]) string $data: INI formatted string to load into the registry string $namespace: Namespace to load the INI string into [optional] 实际应用:

jimport('joomla.registry.registry'); $temp =& new jregistry;

jimport('joomla.filesystem.file');

$date = JFile::read(JPATH_SITE.DS.'language'.DS.'en-GB'.DS.'en-GB.ini');

if($temp->loadINI($date)) echo \

loadObject()

意义装载对象的公共变量到默认的namespace:

语法: boolean loadObject ( &$object, [string $namespace = null], object $object) object $object: The object holding the public vars to load string $namespace: Namespace to load the INI string into [optional] $&object 实际应用:

jimport('joomla.registry.registry'); $object = new stdClass(); $object->name=\ $object->city=\ $object->sex=\

$temp =& new JRegistry('example'); $temp->loadobject($object);

echo $temp->getValue('example.name');

makeNameSpace()

意义: 创建一个namespace

语法: boolean makeNameSpace (string $namespace) string $namespace: Name of the namespace to create 实际应用:

jimport('joomla.registry.registry'); $temp =& new JRegistry();

$temp->makenamespace('joomla');

$data=array('name'=>'bob','address'=>'123 upst'); $temp->loadArray($data,'joomla');

print_r($temp->getvalue('joomla.name'));

toArray()

意义: 翻译一个namespace到一个数组

语法: array toArray ([string $namespace = null]) string $namespace: Namespace to return [optional: null returns the default namespace] 实际应用:

搜索更多关于: joomla - class - 5 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

Haskey() 意义: 是否有关键字 语法: boolean hasKey (key $key) key $key: The key to check 实际应用: jimport('joomla.language.language'); $temp =& new jlanguage; $tem = $temp->haskey('en-GB'); print_r($tem); 结果: True, if the key exists Load() 意义: 对现有的字符串装载一个唯一语言文件和添加结果 语法: boolean load ([string $extension = 'joomla'], [string $baseP

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com