Did you try eval?
$table1 = eval("new $originTable();");
Might has some overhead though!
Cheers,
Gunter
On Thu, Apr 24, 2008 at 8:56 AM, Denis Fohl <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> sorry i forgot the subject in my previous post :
>
> i'm trying to implement a class to manage manytomany relationships in
> backoffice, i'd like to standardize it for reusability.
> I would like to pass to the constructor of my class the name of the tables
> involved (destination table, origin table, intersection table) and that it
> instantiate correspondings Zend_Db_Table objects.
>
> So now is the question : how can i instantiate an object (Zend_Db_Table
> here) with a variable classname :
>
> function __construct ($originTable, $destinationTable) {
>
> $table1 = new $originTable();
> ...
>
> }
>
> i can't find what i want on google (tried call_user_func but that's not
> it).
>
> Thanks.
>
> Denis.
>
>