Codeigniter: Pass data to library funciton

Posted by Kevin Brown on Stack Overflow See other posts from Stack Overflow or by Kevin Brown
Published on 2010-05-11T22:01:13Z Indexed on 2010/05/11 22:04 UTC
Read the original article Hit count: 207

Filed under:
|
|
|

I need my function to do one of two things based on the method variable, but I don't know how to get it done...

My controller:

function survey($method)
{
    $id = $this->session->userdata('id');
    $data['member'] = $this->home_model->getUser($id);
    $data['header'] = "Home";
    $this->survey_form_processing->survey_form($this->_container,$data);
}

Library function:

function survey_form($container,$method)
    {   
        if($method == 1){
            $this->CI->load->view($container,$data);
        }
        if($method == 2){
            Do stuff...
        }

© Stack Overflow or respective owner

Related posts about codeigniter

Related posts about php