[eluser]jmolly[/eluser]
Hello.
I'm writing a little application that exports data from a cvs file to the database.
I need to ask the user through a multiple checkboxs screen what are the categories he wants to store on DB.
I'm using only one controller.
From my main controller I call the view with the checkboxs, and the screen submits back to another function of the controller. Next I have to do the same but for the subcategories. When categories and subcategories are selected, I call a function on my controller that needs to check what categories and subcategories should I store on DB.
I don't know if I'm facing an erroneous design, but I can't find a way to share the categories and subcategories values between my functions calls in the CodeIgniter documentation, because the Controller is instantiated each time it's invoked.
Is correct to use session or cache to do this? I need about 40.000 registers.
Sorry for my poor English and thanks in advance!
Code:
class Controller extends CI_Controller{
var $categories = array();
var $subcategories = array();
function select_categories(){
//Here I show the categories_view
}
function get_categories(){
//Method called from the categories_view
//Here I store the subcategories into a class variable
$this->categories = "Post data"
}
function select_subcategories(){
//Here I show the view
}
function get_subcategories(){
//Method called from the subcategories_view
//Here I store the subcategories into a class variable
$this->subcategories = "Post data"
}
function dump_to_db(){
//Check contents of $this->categories and $this->subcategories but are empty ;(
}
}