Codeigniter: Pass data to library funciton
- by Kevin Brown
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...
}