]> git.nbdom.net Git - nb.git/commitdiff
begin data
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 17 Mar 2016 16:55:34 +0000 (17:55 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 17 Mar 2016 16:55:34 +0000 (17:55 +0100)
lib/php/out.php

index 7ed6c9b808edc81f5b4c1f96467cfdbb4d350013..e4b6c80ac5230c5daa598babdd7c4d37220d35bb 100644 (file)
@@ -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);