Welcome Guest, Not a member yet? Register   Sign In
How do you pass initial parameters to a model that is being loaded?
#1

[eluser]CoderReborn[/eluser]
I have a model called "question" which takes 4 required parameters in the constructor.

The problem is that when I try to load this model from my controller, I get errors because
the "question" constructor is expecting the 4 parameters.


$this->load->model('question') ; /* How do I pass the 4 parameters to the "question" constructor? */


Is "loading" the same thing as instantiating a new object with the PHP "new" keyword?

Thanks.


Messages In This Thread
How do you pass initial parameters to a model that is being loaded? - by El Forum - 05-21-2010, 05:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB