Forum Moderators: coopster

Message Too Old, No Replies

Passing variables to classes?

         

fintan

11:34 am on Sep 14, 2005 (gmt 0)

10+ Year Member



Hi

I have a few classes but I need to pass variables to them. How do you go about doing it? Is there a tutorial handy? Thanks

fintan.

sned

4:27 pm on Sep 14, 2005 (gmt 0)

10+ Year Member



Usually the class has methods that allow for passing variables:

$classname->someMethod($your_var);

Or, depending on permissions, you can directly assign a class variable:

$classname->myvar = $your_var;

This isn't a good way to do it, but it works ...

Or are you looking for something else?

-sned

<edit>
After a quick google, I found this article [phpbuilder.com].
</edit>

fintan

9:03 am on Sep 15, 2005 (gmt 0)

10+ Year Member



Thanks for that I'll take a look and see what I can do