2014-09-19 40 views
0

我剛開始研究codeigniter應用程序。試圖在現有的codeigniter應用程序中加載視圖,需要關於錯誤的建議我得到

該項目很簡單我只需要創建一個視圖,並從數據庫中獲取一些數據。

但是,當我嘗試訪問視圖時,我總是收到這些錯誤。

我不確定這些錯誤是什麼意思。

這是我用來加載默認控制器類中的視圖的代碼,它是與該類中的索引函數分開的函數。

function watchlist(){ 
      $this->load->view("watchlist_view"); 
     } 

以下是我如何訪問瀏覽器中的視圖。

localhost/watchlist/index.php/home/watchlist 

這裏是我得到的錯誤。

A PHP Error was encountered 

Severity: Warning 

Message: session_start(): open(C:/xampp/session_data/localhost\sess_v4oapdmdqjq0s7b1i5j8mb8u95, O_RDWR) failed: No such file or directory (2) 

Filename: helpers/session_helper.php 

Line Number: 18 


Fatal error: Call to undefined method Home::load() in C:\xampp\htdocs\watchlist\application\controllers\home.php on line 23 

Warning: include(application/errors/error_php.php): failed to open stream: No such file or directory in C:\xampp\htdocs\watchlist\system\libraries\Exceptions.php on line 163 

Warning: include(): Failed opening 'application/errors/error_php.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\watchlist\system\libraries\Exceptions.php on line 163 

Warning: include(application/errors/error_php.php): failed to open stream: No such file or directory in C:\xampp\htdocs\watchlist\system\libraries\Exceptions.php on line 163 

Warning: include(): Failed opening 'application/errors/error_php.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\watchlist\system\libraries\Exceptions.php on line 163 

構造家用代碼

class Home extends Controller 
    { 

     var $ministry_name = "Security"; 

     function Home() 
     { 
      parent::Controller(); 
     } 

     function index() 
     { 
      Removed local redirect. All sites will now redirect to main site 
      //Added a check to see if the user is still logged in. If so, remain on the site. 
      if (!$this->authorization->checklogin()) 
      { 
       header('Location: http://mainsite.org/'); 
       exit; 

      } 
      else 
      { 
       redirect("/home/main"); 
       exit(); 
      } 

     } 

     function watchlist(){ 
      //Loads watchlist view 
      $this->load->view("watchlist_view"); 
     } 

回答

相關問題