Re: [PHP] How to call a function from $classname

2005-03-15 Thread Jochem Maas
Colin Ross wrote: under PHP5 at least, you should only be able to use $Class::method for public methods with a class, correct? there is a reason the class is called Test. say it slowly. let it sink in... ;-) basically write a test class and play with it, e.g: class Test { public static functio

Re: [PHP] How to call a function from $classname

2005-03-15 Thread Jochem Maas
André Pletschette wrote: Thankyou, That works ;) Here the code: $get_table_fields_cmd = $classname."::intializeClass(\$dbConnect);"; eval($get_table_fields_cmd); welldone for figuring a way to do it! I have to tell you tho that eval() is a very heavy function to use - my advice don't use it unless

Re: [PHP] How to call a function from $classname

2005-03-15 Thread Jochem Maas
André Pletschette wrote: Hi, What do I have to do to call a function from $classname? Like: $classname->test( ); class Test { function doIt() { echo "done it!\n"; } } $className = "Test"; $t = new $className; $t->doIt(); // also look at the functions // call_user_func() and call_user_func

Re: [PHP] How to call a function from $classname

2005-03-15 Thread André Pletschette
Thankyou, That works ;) Here the code: $get_table_fields_cmd = $classname."::intializeClass(\$dbConnect);"; eval($get_table_fields_cmd); André François-Xavier Lacroix wrote: Maybe With the eval() function ? Hi, What do I have to do to call a function from $classname? Like: $classname->test( ); Tha

Re: [PHP] How to call a function from $classname

2005-03-15 Thread Richard Davey
Hello André, Tuesday, March 15, 2005, 3:42:44 PM, you wrote: AP> What do I have to do to call a function from $classname? Like: $classname->test( ); Erm, you do exactly that. Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services "I do not fear computers. I f

Re: [PHP] How to call a function from $classname

2005-03-15 Thread François-Xavier Lacroix
Maybe With the eval() function ? Hi, What do I have to do to call a function from $classname? Like: $classname->test( ); Thankyou, André -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to call a function from $classname

2005-03-15 Thread Dan Joseph
> What do I have to do to call a function from $classname? > > Like: $classname->test( ); Two methods: First: $classname = new ClassName(); $classname->test(); Second: ClassName::test(); -- -Dan Joseph "Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, a

[PHP] How to call a function from $classname

2005-03-15 Thread André Pletschette
Hi, What do I have to do to call a function from $classname? Like: $classname->test( ); Thankyou, André -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php