比如user model的public function roleList $optionLabels = TheseThoseHelpergetRoleValues; $uRole = Yii$app-user-identity-uRole; if $uRole == TheseThoseHelperUROLE_SUPERADMINISTRATOR 得看你是谁了Model特供 return
可以在函数中加入以下代码:
if (!isset($optionLabels)) {
trigger_error('$optionLabels is not set', E_USER_NOTICE);
}
这样在$optionLabels没有被赋值的情况下,会触发一个E_USER_NOTICE级别的错误,可以在PHP Warning页面中看到。
原文地址: https://www.cveoy.top/t/topic/c89V 著作权归作者所有。请勿转载和采集!