#function out_tag_head(&$row,$o) { return ''; }
function out_tag_head(&$data,$o) {
#return var_dump($row,true); return '';
- $o['tag'] = isset($o['tag_head']) ? $o['tag_head'] : $o['tag'];
+ if (empty($o['tag']) and isset($o['tag_head'])) $o['tag'] = $o['tag_head'];
$row = out::ar_first($data);
if (!out::is_hash($row)) $row = $data;
if (!is_array($row)) return 0;
function out_tag(&$row,$o) {
#var_dump($row); return '';
# NB 07.03.16 if (!is_array($row)) return var_export($row,true);
+ if (isset($o['tag_enclose'])) echo '<'.$o['tag_enclose'].'>'.PHP_EOL;
foreach ($row as $k => $v) {
#if (!is_scalar($v)) continue;
# NB 07.03.16 if (!is_scalar($v)) return var_export($row,true);
- $k = empty($o['tag']) ? $k : $o['tag'];
- return ''
+ if (!empty($o['tag'])) {
+ $class = ' class="'.$k.'"';
+ $k = $o['tag'];
+ } else {
+ $class = '';
+ }
+ echo ''
.(OUT_EOL ? ' ' : '')
- .(isset($o['tag_enclose']) ? '<'.$o['tag_enclose'].'>' : '')
- ."<$k>$v</$k>"
- .(isset($o['tag_enclose']) ? '</'.$o['tag_enclose'].'>' : '')
+ #.(isset($o['tag_enclose']) ? '<'.$o['tag_enclose'].'>' : '')
+ ."<$k$class>$v</$k>"
+ #.(isset($o['tag_enclose']) ? '</'.$o['tag_enclose'].'>' : '')
.OUT_EOL
;
}
+ if (isset($o['tag_enclose'])) echo '</'.$o['tag_enclose'].'>'.PHP_EOL;
}
function out_xml(&$row,$o) {