Hey, everyone --
Quick question. I'm working on a project wherein I've established a fair-sized object hierarchy (at least in the manner in which objects include each other). Most functions center around a main object, which requires (via require_once()) most of the other objects -- some of which are nothing more than data containers.
However, several of the objects were made to group together specialized functions, such as for searching the database. The problem is that every page in the application requires the main object, but I only want it, in turn, to require its little servant objects if their functions are being utilized...otherwise, I don't want to download the extra 20-30k or more code.
Can I do a require_once() on a class from within a function which needs it? It seems like that wouldn't work, since the class code would be placed in the middle of another class's function. I'm wondering if there's another way....
Thanks!
-Jeremy