Forum Moderators: coopster

Message Too Old, No Replies

Using a class within another class

         

Nutter

4:15 am on Jun 18, 2006 (gmt 0)

10+ Year Member



I think I'm just missing something...

I have a class called classConfig that I need to be able to use from within classReports. How do I define classConfig so I can use runctions from classConfig within functions of classReport?

Say, for example, that classConfig has a function ->company_name that I need to use in a report. How would that work? Whatever I've tried hasn't seemed to be right.

Habtom

4:54 am on Jun 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Create the class classReports as it extends the previous class for you to use the classConfig's functions.

It goes as:

class classReports extends classConfig{
//Your new functions here
}

Now you can use the functions of classConfig in classReports as they were inside that class.

Habtom