Welcome Guest, Not a member yet? Register   Sign In
Pass a variable between a controller
#1

[eluser]Taff[/eluser]
Is it possible (or advisable) to pass variables between controllers?

I have one controller which I am using to upload a file to the server.
After it has been uploaded I would like that variable accessible via my parse_csv controller so this is roughly what I have:

Code:
class Katalog extends Controller {

    function Katalog(){
        parent::Controller();    
        $this->csv_file;
    }
    function upload_csv(){
        $this->load->library('Upload');
        if ($this->upload->uploaded) {
        //Save $this->csv_file for future reference somewhere
        $this->csv_file=$this->upload->file_name;
        //load view with link to parse_csv
        }
    }
    function parse_csv(){
        $this->load->library('Csvparser');
        //grab the data we saved in upload_csv
        $file_name=$this->csv_file;
        $this->csvparser->parse($file_name);
    }
}

Sorry for the silly question, I can't find anything in the forum about it which is probably down to me being the only one who doesn't know how to do it.

Thanks for any help!
Taff


Messages In This Thread
Pass a variable between a controller - by El Forum - 07-29-2008, 04:48 AM
Pass a variable between a controller - by El Forum - 07-29-2008, 04:58 AM
Pass a variable between a controller - by El Forum - 07-29-2008, 07:13 AM
Pass a variable between a controller - by El Forum - 07-29-2008, 10:00 AM
Pass a variable between a controller - by El Forum - 07-29-2008, 11:13 AM
Pass a variable between a controller - by El Forum - 07-29-2008, 03:20 PM
Pass a variable between a controller - by El Forum - 07-30-2008, 01:04 AM
Pass a variable between a controller - by El Forum - 07-30-2008, 03:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB