Posted in PHP onApril 23, 2011
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解决方法
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@