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

[eluser]Ian_B[/eluser]
The classes are very simple just to prove the point.

Just setting some member values via the constructor and a function to display the values, using echo() rather than doing it properly with a view.
The classes are inter-related as I have a base class and four classes that inherit and extend that base class, as I wanted to check the polymorphic behaviour.

No error messages. When it fails to work I just get a blank page.
PHP Error reporting is supposedly turned up to maximum (E_ALL | E_STRICT).

Ian

EDIT1: Just seen your edit. My base class does extend the Model Class, so I'll try not doing that.

EDIT2: Bingo!! Thanks.
#12

[eluser]TaylorOtwell[/eluser]
I usually register an autoloader for my "business model" type data structures. Normally, I don't have them inherit CI_Model. Since i have the autoloader registered, I can just new up as many as I want anytime. For my data repositories, I'll extend the CI_Model and use the regular CodeIgniter model loader, because it's usually fine to have a singleton instance of something like that.

Coming from the .NET world, this was a little bit of a hurdle for me in CI as well.
#13

[eluser]Ian_B[/eluser]
My next step is an autoloader.

I regressed back to require_once() at the top of the classes as I couldn't determine if my problem was caused by my autoloader function being in the wrong place, or that it was in the right place but not working. Having got my classes loading, I can go back to the autoloader.

Where do you normally put your autoload function?
#14

[eluser]TaylorOtwell[/eluser]
I usually put mine at the bottom of application/config
#15

[eluser]Bart Mebane[/eluser]
Quote:I usually put mine at the bottom of application/config
That's where I put mine too.




Theme © iAndrew 2016 - Forum software by © MyBB