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
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
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
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
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
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
> 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
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
8 matches
Mail list logo