2010-07-09 66 views
1

我使用的域名http://www.domainname.com/admin/users/edit/1我的網址數據不傳遞給我的笨控制器的功能

class Cal_Admin extends Controller { 

function Cal_Admin() 
{ 
    parent::Controller(); 
    $this->load->model('events/model_events'); 
    $this->load->model('users/model_users'); 
} 

function index() 
{ 
    $data['events'] = $this->model_events->get_home_entries(); 
    $data['users'] = $this->model_users->_get_all(); 
    $this->load->view('admin/admin_head'); 
    $this->load->view('admin/admin_menu'); 
    $this->load->view('admin/admin',$data); 
    $this->load->view('admin/admin_foot'); 
} 

function users($action=NULL, $uid=NULL) 
{ 
    $this->load->view('admin/admin_head'); 
    $this->load->view('admin/admin_menu'); 
    $segments = $this->uri->total_segments(); 

    switch ($action) { 
     case "add" : 
      $this->load->view('admin/users/form'); 
     break; 
     case "edit" : 
      $data['user'] = $this->model_users->_get_user($uid); 
      $this->load->view('admin/users/form',$data); 
     break; 
     default: 
      $data['users'] = $this->model_users->_get_all(); 
      $data['action'] = $action; 
      $this->load->view('admin/users',$data); 
    } 
    $this->load->view('admin/admin_foot'); 
} 
+0

你的類名稱是Cal_Admin,但在url中是admin – ggfan 2010-07-09 03:41:33

回答

0

我修正了它自己。

我已經在autoload.php文件中重新聲明瞭uri庫。我知道cal_admin是類,我在URL中使用它,我在例子中出於某種原因拿出它。

相關問題