Jump to content

automatically loading a class file when class is called?


Liquid Fire

Recommended Posts

I remember seeing somewhere where if they included just one file, this file would include the required file where a class object was crated.  so like if class_foo.php was need to use Class foo, the one file, lets call is auto_include.php, would be included.  then if you did:

 

$bar = new Foo();

 

where creates an object of foo, the  auto_include.php file had code in there that would automatically include the class_foo.php file.  anyone know of anything like this becuase this would be so useful as i would only every to to only include 1 file and then i would not have to worry about remembering to include the proper files for my classes?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.