Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Reusable modules and code organization?
October 12, 2006, 9:00 pm
rate this thread
Re: Reusable modules and code organization?
Good news, its very easy.
Set up any directory structure you like - it doesn't have to be in the
web root hierarchy. For example I have a sub-directory for classes then
project-based directories for tools, testing, and so on.
Now look at php.ini and you will see include_path. (Also if you're
interested look at set_include_path which might come in handy if stuffed
into a project specific 'configuration' php include.
In your code put require_once('myCleverClass.php'); and you're away.
FWIW All my code is PHP-generates-HTML ie used as a 'proper' language
not as a bit of extra in an HTML file.
PETER FOX Not the same since the porcelain business went down the pan
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk