Welcome Guest, Not a member yet? Register   Sign In
My own classes and codeigniter
#9

[eluser]Ian_B[/eluser]
Bart,

Thanks for that. Worked for me.

Apologies to Leo for Hijacking his thread, but wanted to say 'thanks' and highlight a couple of complications.

using
Code:
$this->load->model('Modelname');
works, but where in your example you pass parameters to the constructor
Code:
new Card(8, 'Hearts');
it's necessary to have default values for the params in the constructor if you don't want the standard Codeigniter model load to complain about a lack of expected params.

using the
Code:
require_once(APPPATH."models/Modelname.php");
method also works, however I found it was necessary to have at least one model loaded using the
Code:
$this->load->model('Modelname');
method otherwise it doesn't work at all.

I now have an dummy class which just has a constructor and one method, both of which are empty. I load it using the classic Codeigniter model load, and suddenly all my 'real' classes loaded with require_once work just fine.

I'm sure there's a logical explanation, but I'll settle for the fact that it works.

Thanks again
Ian B


Messages In This Thread
My own classes and codeigniter - by El Forum - 11-15-2010, 04:20 PM
My own classes and codeigniter - by El Forum - 11-15-2010, 05:15 PM
My own classes and codeigniter - by El Forum - 11-16-2010, 12:57 AM
My own classes and codeigniter - by El Forum - 11-16-2010, 08:00 AM
My own classes and codeigniter - by El Forum - 11-16-2010, 10:10 AM
My own classes and codeigniter - by El Forum - 11-16-2010, 10:24 AM
My own classes and codeigniter - by El Forum - 11-16-2010, 10:29 AM
My own classes and codeigniter - by El Forum - 11-16-2010, 04:06 PM
My own classes and codeigniter - by El Forum - 11-18-2010, 07:49 AM
My own classes and codeigniter - by El Forum - 11-18-2010, 09:48 AM
My own classes and codeigniter - by El Forum - 11-18-2010, 02:31 PM
My own classes and codeigniter - by El Forum - 11-18-2010, 05:34 PM
My own classes and codeigniter - by El Forum - 11-19-2010, 03:15 AM
My own classes and codeigniter - by El Forum - 11-19-2010, 05:19 AM
My own classes and codeigniter - by El Forum - 11-19-2010, 11:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB