我想在「後的控制器構造」掛鉤,以獲得所謂的控制器的名稱:笨在後的控制器構造鉤子獲取當前控制器
<?php
function authenticate() {
$CI =& get_instance();
$controller = $CI->router->class;
}
但我收到此錯誤信息:
一個PHP錯誤遇到
嚴重性:注意
消息:試圖讓非OB的財產JECT
文件名:鉤/ post_controller_constructor.php
行號:5
回溯:
文件:/ ... /CodeIgniter-3.0rc3/application/hooks/post_controller_constructor.php 行:5 功能:_error_handler
文件:/ ...的index.php 線:292 功能:require_once
任何想法爲什麼?
我已經嘗試過,儘管它是不贊成的方法。不過謝謝你的建議。 –
您需要做什麼?沒有其他辦法。 –
我需要它來檢查用戶是否在運行不在例外列表中的方法之前登錄。是的,我找到了另一種方式! =) –