Welcome Guest, Not a member yet? Register   Sign In
Where to 'include' base classes?
#1

[eluser]steward[/eluser]
Code:
class MyBaseObject
{
  //... has stuff I use in many misc objects
}
class MyBaseView
{
  //... has stuff common to views
}
// etc for controllers, models...

What is the CI style for including base classes?

The loader functions seem to want to instantiate objects: but the class to be instantiated extends something else. Where do I put the something else?

Many ways to skin this cat. Is there a "CI approved" way?

I'm guessing:
a) include it in config, or
b) put it on the path and require_once as needed.

Thank you!
#2

[eluser]stuffradio[/eluser]
What exactly are you trying to accomplish? What is it you are wanting to include?
#3

[eluser]Colin Williams[/eluser]
include(), require() and the like are just fine. You are correct that there is no convention for loading objects like that (CI uses objects entirely differently.) So, in the absence of a CI convention, it's back to plain-old PHP, and there's nothing wrong with plain-old PHP in CodeIgniter.




Theme © iAndrew 2016 - Forum software by © MyBB