Exemple #1
0
 public function renderChildren(Kint_Object $o)
 {
     $contents = array();
     $tabs = array();
     foreach ($o->getRepresentations() as $rep) {
         $result = $this->renderTab($o, $rep);
         if (Kint_Object_Blob::strlen($result)) {
             $contents[] = $result;
             $tabs[] = $rep;
         }
     }
     if (empty($tabs)) {
         return '';
     }
     $output = '<dd>';
     if (count($tabs) === 1 && $tabs[0]->labelIsImplicit()) {
         $output .= reset($contents);
     } else {
         $output .= '<ul class="kint-tabs">';
         foreach ($tabs as $i => $tab) {
             if ($i === 0) {
                 $output .= '<li class="kint-active-tab">';
             } else {
                 $output .= '<li>';
             }
             $output .= Kint_Object_Blob::escape($tab->getLabel()) . '</li>';
         }
         $output .= '</ul><ul>';
         foreach ($contents as $tab) {
             $output .= '<li>' . $tab . '</li>';
         }
         $output .= '</ul>';
     }
     return $output . '</dd>';
 }