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

[eluser]Jilani Jidni[/eluser]
[quote author="Taff" date="1217346497"]

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);
    }
}
[/quote]

its not clear when you call this parse_csv. if you call this function at the end of upload_csv then try this

Code:
class Katalog extends Controller {

    var $csv_file;

    function Katalog(){
        parent::Controller();    
    }

    rest of the code here
    
}

otherwise use session.


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