Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- storing php5 classes and function
- Alamin Ahmed
December 22, 2007, 7:22 pm
rate this thread
submitted by other developers?
let's say i want to do the following
$obj = new $userclass();
basically developers will have away to write different "print" method
of given array. How and where would I store their class source fine
and how would I load and use to display?
Re: storing php5 classes and function
One nice thing to notice: an included file can return a value, which may
be an instance. So you could write a class in a file that looks like this:
return new WhatEver();
And then call that dynamically:
$obj = require($pathToWhatEver);
I use this trick for my unit testing system.