From: Nicolas Boisselier Date: Thu, 17 Mar 2016 16:55:34 +0000 (+0100) Subject: begin data X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=c5aff854eeb7054644002e7afae9ce4fb1097f11;p=nb.git begin data --- diff --git a/lib/php/out.php b/lib/php/out.php index 7ed6c9b8..e4b6c80a 100644 --- a/lib/php/out.php +++ b/lib/php/out.php @@ -53,7 +53,7 @@ class Out extends Nb { if (!empty($type) and !empty($data)) return $this->rows($type,$data,$head); } - public static function begin($o,$head) { + public static function begin($o,$head,$data) { if (!empty($o['enclose'])) echo $o['enclose'][0]; if (!isset($o['head'])) return; @@ -109,13 +109,13 @@ class Out extends Nb { if (self::is_hash($data)) $data = array($data); if (is_scalar($data)) $data = array($data); - if (!is_array($head) and !is_bool($head)) $head = array($head); + if (is_scalar($head) and !is_bool($head)) $head = array($head); $tot = count($data); $count = 0; # Function head - self::begin($conf,$head); + self::begin($conf,$head,$data); foreach ($data as $row) { if ($count>0) out::concat($conf);