开发者

My url data isn't passing to my codeigniter controller's function

开发者 https://www.devze.com 2023-01-06 01:36 出处:网络
The domain I\'m using is http://www.domainname.com/admin/users/edit/1 class Cal_Admin extends Controller {

The domain I'm using is http://www.domainname.com/admin/users/edit/1

class Cal_Admin extends Controller {

function Cal_A开发者_开发百科dmin()
{
    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');
}


I Fixed it myself.

I had the uri library redeclared in the autoload.php file. I know the cal_admin was the class and I was using it in the url, i took it out for some reason in the example.

0

精彩评论

暂无评论...
验证码 换一张
取 消