Jump to content

How Do You Pass a Variable Value into a Constructor?


webref.eu

Recommended Posts

Hi All

 

How do you pass a variable value into a constructor? 

 

When a class is being included in a page, and that class contains a constructor, I don't get how you can send variable values into that constructor. 

 

I know how to send a variable value into a function of an instantiated object, but this is different ...

 

Thanks  8)

OK, thanks guys, but how does this work when the class is being called with: 

 

require_once('class.classname.php');

 

How can I send the variable values when require_once is being used? 

 

Thanks  8)

 

You pass the value(s) when you create the object, not when you import the file.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.