From: Robert Sesek Date: Tue, 11 Mar 2008 19:16:51 +0000 (-0400) Subject: In BSPrinterElementTable::__construct(), we can now on-the-fly create Label elements... X-Git-Tag: 3.1.0~17 X-Git-Url: https://src.bluestatic.org/?a=commitdiff_plain;h=54681a89274101665363fed4790f028e275453ff;p=isso.git In BSPrinterElementTable::__construct(), we can now on-the-fly create Label elements from just strings to save us some code * CHANGES * PrinterElementTable.php: (BSPrinterElementTable::__construct): If the child is not an instance of BSPrinterAbstract, make it into a Label --- diff --git a/CHANGES b/CHANGES new file mode 100644 index 0000000..5e66e52 --- /dev/null +++ b/CHANGES @@ -0,0 +1,3 @@ +3.1.0 +=================== +- Change: BSPrinterElementTable:__construct() can now take straight strings and convert them into BSPrinterElementLabel's \ No newline at end of file diff --git a/PrinterElementTable.php b/PrinterElementTable.php index 17e635b..2fe58b0 100644 --- a/PrinterElementTable.php +++ b/PrinterElementTable.php @@ -63,6 +63,13 @@ class BSPrinterElementTable extends BSPrinterAbstract $childs = func_get_args(); if (is_array($childs)) { + foreach ($childs as $key => $value) + { + if (!($value instanceof BSPrinterAbstract)) + { + $childs[$key] = BSPrinterElementLabel::make($value); + } + } $this->children = $childs; } }