_element($elements[0], '', 0); } /** * Protected element */ protected function _element($data, $tab, $start) { static $start; $output = ''; $attrs = ''; $tab = str_repeat("\t", (int) $start); if( ! is_array($data) ) { return $data.$eof; } else { foreach( $data as $k => $v ) { if( IS::realNumeric($k) ) { $value = $k; $k = 'li'; } else { $value = ''; } $end = Base::prefix(Arrays\GetElement::first(explode(' ', $k))); if( ! is_array($v) ) { $output .= $tab . '<' . $k . '>' . $v . '<' . $end . '>' . EOL; } else { if( stripos($k, 'ul') !== 0 && stripos($k, 'ol') !== 0 && $k !== 'li' ) { $value = $k; $k = 'li'; $end = Base::prefix($k); } else { $value = ''; } $output .= $tab . '<' . $k . '>' . $value . EOL . $this->_element($v, $tab, $start++) . $tab . '<' . $end . '>' . $tab . EOL; $start--; } } } return $output; } }