Leeoniya
01-15-2008, 11:43 PM
i have a class:
class tableClass {
public $testvar;
}
the function of the full class is to assemble a table. I have .inc files for each table that must set multiple public properties of this table class. however, i want to keep the .inc files for each table uniform. like
$table->testvar = 'hello;
this presents a problem, because it requires that each class instance is called "$table". i thought i could solve the issue by using variable variables and leave the inc files as is, but use
$myTable1 = new tableClass();
$$table = $myTable1;
and change the inc files to use $$table everywhere without hardcoding the instance names
$$table->testvar = 'hello';
class tableClass {
public $testvar;
}
the function of the full class is to assemble a table. I have .inc files for each table that must set multiple public properties of this table class. however, i want to keep the .inc files for each table uniform. like
$table->testvar = 'hello;
this presents a problem, because it requires that each class instance is called "$table". i thought i could solve the issue by using variable variables and leave the inc files as is, but use
$myTable1 = new tableClass();
$$table = $myTable1;
and change the inc files to use $$table everywhere without hardcoding the instance names
$$table->testvar = 'hello';