Welcome Guest, Not a member yet? Register   Sign In
error with loading model
#6

[eluser]jedd[/eluser]
[quote author="babyboss" date="1245371901"]I am pretty new to codeigniter, the code snippet is from a book I have been reading. I am not sure how I correct the problem.[/quote]

If the quote is verbatim - if the author really did try to load a view ($this->load->view...) from a model as you've shown above - then you should probably stop reading that book.

The way to correct the problem in the immediate short term is to relocate your view loads into your controller. At least, I expect it'll resolve your problem. Certainly it'll make your life much easier.

Think of the controller as being, well, kind of like it was in control. And your model as being subservient to the controller. The model does nothing other than take and receive data (and do whatever fiddling is necessary to your database).

The controller talks to the model, and similarly it talks to (and controls) the view(s).


Messages In This Thread
error with loading model - by El Forum - 06-18-2009, 05:01 AM
error with loading model - by El Forum - 06-18-2009, 05:11 AM
error with loading model - by El Forum - 06-18-2009, 05:23 AM
error with loading model - by El Forum - 06-18-2009, 05:36 AM
error with loading model - by El Forum - 06-18-2009, 01:38 PM
error with loading model - by El Forum - 06-18-2009, 01:44 PM
error with loading model - by El Forum - 06-18-2009, 07:08 PM
error with loading model - by El Forum - 06-23-2009, 08:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB