第一范文网 - 专业文章范例文档资料分享平台

joomla - class - 5

来源:用户分享 时间:2025/5/19 11:16:57 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

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 的文档
joomla - class - 5.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c5nxwo255om9d31q9oeeq_3.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top