Question : classes within classes?

I am writing a class which extends another class.
In this class, I need to instantiate yet another class.

Is it possible to do something like this:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
class ReportGenerator extends ObjectModel
{

  require_once('tcpdf/config/lang/eng.php');
  require_once('tcpdf/tcpdf.php');
  
  // extend TCPF with custom functions
  class MYPDF extends TCPDF {
  
    // some overrirdden TCPDF class methods going here.

  }

  // DO a whole lot of things to build the PDF file.

}

Answer : classes within classes?

yes, that is possible from what I know.
did you try/get some error messages?
Random Solutions  
 
programming4us programming4us