手机
当前位置:查字典教程网 >编程开发 >php教程 >fleaphp rolesNameField bug解决方法
fleaphp rolesNameField bug解决方法
摘要:复制代码代码如下:functionfetchRoles($user){if($this->existsLink($this->rolesFi...

复制代码 代码如下:

function fetchRoles($user)

{

if ($this->existsLink($this->rolesField)) {

$link =& $this->getLink($this->rolesField);

$rolenameField = $link->assocTDG->rolesNameField;

} else {

$rolenameField = 'rolename';

}

if (!isset($user[$this->rolesField]) ||

!is_array($user[$this->rolesField])) {

return array();

}

$roles = array();

foreach ($user[$this->rolesField] as $role) {

if (!is_array($role)) {

return array($user[$this->rolesField][$rolenameField]);

}

$roles[] = $role[$rolenameField];

}

return $roles;

}

在页面中定义了rolesNameField 也无效,因此在下面这段后面加多一行

复制代码 代码如下:

$rolenameField = $link->assocTDG->rolesNameField;

复制代码 代码如下:

$rolenameField = $rolenameField ? $rolenameField : 'rolename';

【fleaphp rolesNameField bug解决方法】相关文章:

php操作redis缓存方法分享

php循环table实现一行两列显示的方法

php猴子选大王问题解决方法

php使用for语句输出三角形的方法

PHP5 安装方法

两种php调用Java对象的方法

php获取系统变量方法小结

php 字母大小写转换的方法

php生成圆角图片的方法

phpBB BBcode处理的漏洞

精品推荐
分类导航