fleaphp rolesNameField bug解决方法

2015-01-24信息快讯网

fleaphp rolesNameField bug解决方法,需要的朋友可以参考下。

 
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'; 
ThinkPHP之getField详解
ThinkPHP CURD方法之field方法详解
PHP中CURL的CURLOPT_POSTFIELDS参数使用细节
PhpMyAdmin出现export.php Missing parameter: what /export_type错误解决方法
ThinkPHP 连接Oracle数据库的详细教程[全]
Zend Framework中的简单工厂模式 图文
工厂模式在Zend Framework中应用介绍
PHP Warning: PHP Startup: Unable to load dynamic library \ D:/php5/ext/php_mysqli.dll\
PHP file_exists问题杂谈
simplehtmldom Doc api帮助文档
Notice: Trying to get property of non-object problem(PHP)解决办法
smarty巧妙处理iframe中内容页的代码
PHP教程之PHP中shell脚本的使用方法分享
php木马webshell扫描器代码
PHPExcel读取Excel文件的实现代码
PHP下利用shell后台运行PHP脚本,并获取该脚本的Process ID的代码
PHP 命令行工具 shell_exec, exec, passthru, system详细使用介绍
mysql_num_rows VS COUNT 效率问题分析
FirePHP 推荐一款PHP调试工具
fleaphp crud操作之find函数的使用方法
fleaphp crud操作之findByField函数的使用方法
fleaphp常用方法分页之Pager使用方法
PHP导入Excel到MySQL的方法
php将fileterms函数返回的结果变成可读的形式
The specified CGI application misbehaved by not returning a complete set of HTTP headers
PHP stream_context_create()作用和用法分析
php中突破基于HTTP_REFERER的防盗链措施(stream_context_create)
php函数之子字符串替换 str_replace
php expects parameter 1 to be resource, array given 错误
zend framework多模块多布局配置
php simplexmlElement操作xml的命名空间实现代码
linux下删除7天前日志的代码(php+shell)
PHP生成excel时单元格内换行问题的解决方法
©2014-2024 dbsqp.com