方法应用
:
getAcl
意义
:
这个方法返回 JAuthorization 对象的标识符,如果它不存在就创建一个。
语法
:
object JAuthoriz ation & getACL ()
实际应用
:
example1
Variables array $acl = null;
返回在当前访问控制列表里有多少个对象
(ACL 权限控制系统 )
$acl =& JFactory::getACL();
echo
“
There are
”
.$acl->acl_count.
“
objects in the acl.
”
;
结果
:
输出当前访问控制列表里对象的个数 .
Result
:
There are 101 objects in the acl
example2
Methods int getCheckMode();
得到检查方式
$check = &Jfactory::getACL();
echo $check->getCheckMode();
结果
:
得到当前的检查模式 .
Result
:
0
getCache
意义
:
这个方法创建一个 JCache 子类对象 , 当方法被调用时候 , 一个合适的子类对象被实例化并且被返回 ,
语法
:
object JCache&getCache($group,$handler)
$group 是个包含存储包名称的字符串 , 这个参数是可选的 , 缺省是一个空字符串 .
$handler 是个包含存储类名称的字符串 , 参数是可选的 , 缺省是方法 .
实际应用
:
example1
Method boolean clean ([string $group = null],[string $mode = 'group'])
string $group
:
The cache data group
string $mode
:
The mode for cleaning cache [group
|
notgroup]
以给定的方式清除缓存
$cache =& Jfactory::getCache();
$cache->clean();
结果
:
清空缓存 .
example2
Variables array $_errors
以数组的形式返回错误信息
$cache =& Jfactory::getCache();
$arr = $cache->_errors;
print_r($arr);
结果
:
返回一组错误信息 .
getApplication
意义
:
返回全局性 JApplication 标识符,如果不存在就创建一个 .
语法
:
object JApplication &getApplication ([mixed $id = null],[array $config = array()],[$prefix = 'J'])
mixed $id :A client identifier or name.
array $config
:
An optional associative array of configuration settings.
$prefix
实际应用
example1
Variables array $_name = null
$application = & Jfactory::getApplication();
$application->_name;
结果
:
得到当前应用程序的程序名 .
返回一个指向 JApplication 对象的标识符
评论0
最新资源