The constructor can now take a variable number of arguments as children
authorRobert Sesek <rsesek@bluestatic.org>
Mon, 25 Dec 2006 21:14:50 +0000 (21:14 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Mon, 25 Dec 2006 21:14:50 +0000 (21:14 +0000)
PrinterTableElement.php

index 18a1702dbf9768d95d7a8128e64d5488cabb6ac5..6bf70c438f33eea851d26d17e29785205db34999 100644 (file)
@@ -53,6 +53,22 @@ class BSPrinterTableElement extends BSPrinterElement
        */
        private $colspan = 0;
        
+       // ###################################################################
+       /**
+       * Creates a table element; takes a variable number of arguments which
+       * are added as children in the order passed
+       *
+       * @param        BSPrinterTableElement...        Variable number (or no) children
+       */
+       public function __construct()
+       {
+               $childs = func_get_args();
+               if (is_array($childs))
+               {
+                       $this->children = $childs;
+               }
+       }
+       
        // ###################################################################
        /**
        * Prints a simple row of text and text