What I’m trying to do is use a temporary object to store values and then reset it back to empty without having to uset($tmpObject); ?
Here is some example code:
class Object {
function ResetObject(){
// code to remove all variables in an object here?
}
}
$tmpObject = new Object();
foreach ($myArray as $arr){
$tmpObject->val1 = "string1";
$tmpObject->val2 = "string2";
$tmpObject->val3 = "string3";
$tmpObject->val4 = "string4";
$template->set('tmpObject',$tmpObject);
$tmpObject->ResetObject();
}
Anyone have any ideas?
See: Object iteration