• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Controller / model separation, templating

#4
[eluser]batfastad[/eluser]
Thanks for the reply. That's helped alot.

I'll try re-explaining #3.
I'm assuming that each time I run
Code:
$this->load->database();
a DB connection is created, as I have autoinit set to TRUE in my config

I have a constructor in each model which runs the above code and creates the connection.
Does this constructor only get fired when I call the first method in a model?
I assume the constructor won't fire when I make subsequent calls to methods in the model as the model class has already been constructed?

And a further question:
6) Do I use a view for all output, e.g.: if I'm outputting JSON, XML or an ical/vcard?
Or are views just for HTML?

Cheers, B


Messages In This Thread
Controller / model separation, templating - by El Forum - 09-21-2012, 11:00 AM
Controller / model separation, templating - by El Forum - 09-21-2012, 11:03 AM
Controller / model separation, templating - by El Forum - 09-21-2012, 03:47 PM
Controller / model separation, templating - by El Forum - 09-21-2012, 11:53 PM
Controller / model separation, templating - by El Forum - 09-22-2012, 12:41 AM
Controller / model separation, templating - by El Forum - 09-22-2012, 05:23 PM
Controller / model separation, templating - by El Forum - 09-23-2012, 11:31 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.