PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have this code so far. I am trying to automatically scan a directory (and sub-directory) and include all files ending in ".actions.php" Right now it will include all of the ones in the main directory, but how can I get it to go into sub-directories?
__autoload is definitely the best solution if you can use it that way. Thinking specifically about classes, like if the Foo_BarActions class is contained in foo/bar.actions.php: you can break the class name into "Foo" and "Bar" then look for the appropriate file.
This can work for something else, but I'm calling functions that are contained in the .action.php extention. But does autoload pretty much do as it say, and just loads a class only when you need it? Without having to call the function __autoload?