[eluser]halwaraj[/eluser]
This is more of design based question.
I have to insert data into the DB. Data comes from a single page. The data needs to go to different tables.
The flow is as follows:
I have a controller from where I would call a function in a helper class to insert data into database. This class has to instantiate the model class that would then actually insert the data into DB.
Now, I tried to use the $this->load in the helper class but it is not allowed. Now, I loaded the Model class in controller and passed it as an argument to the function in helper class. This worked fine.
Now, I need to insert data to diff tables. So this does not look good to instantiate number of model class and pass them to helper class. The flow comes to the controller many times. So instantiating the classes and not using them does not look good.
Any suggestion?