我使用cakephp。在所有的頁,有這樣的警告:cakephp:strtolower()期望參數1是字符串,數組給定
警告(2):用strtolower()預計參數1是字符串,數組給定[CORE/SRC /控制器/組件/ AuthComponent.php,管線337]
在管線337:
protected function _isAllowed(Controller $controller)
{
$action = strtolower($controller->request->params['action']);
return in_array($action, array_map('strtolower', $this->allowedActions));
}
如何解決這個問題呢?
向我們展示如果用'var_dump($ controller-> request-> params ['action'])exit;';'替換'strtolower'行;'也告訴我們你要做什麼。 – BeetleJuice
可能'$ this-> allowedActions'包含一個子數組。請考慮編輯您的問題,添加'$ this-> allowedActions'的調試 – arilia