original_string: protected function renderItem($item = [])
      {
          $itemOptions = ArrayHelper::getValue($item, 'options', []);
  
          $headerOptions = ArrayHelper::getValue($item, 'header', []);
          $headerContent = ArrayHelper::remove($headerOptions, 'content');
          $headerTag = ArrayHelper::remove($headerOptions, 'tag', 'div');
  
          $bodyOptions = ArrayHelper::getValue($item, 'body', []);
          $bodyContent = ArrayHelper::remove($bodyOptions, 'content', []);
          $bodyTag = ArrayHelper::remove($bodyOptions, 'tag', 'div');
  
          if (!$headerContent && !$bodyContent) {
              return '';
          }
  
          $html[] = Html::beginTag('li', $itemOptions);
          if ($headerContent) {
              Html::addCssClass($headerOptions, ['header' => 'collapsible-header']);
              $html[] = Html::tag($headerTag, $headerContent, $headerOptions);
          }
          if ($bodyContent) {
              Html::addCssClass($bodyOptions, ['body' => 'collapsible-body']);
              $html[] = Html::tag($bodyTag, $bodyContent, $bodyOptions);
          }
          $html[] = Html::endTag('li');
  
          return implode("\n", $html);
      }
code: protected function renderItem($item = [])
      {
          $itemOptions = ArrayHelper::getValue($item, 'options', []);
  
          $headerOptions = ArrayHelper::getValue($item, 'header', []);
          $headerContent = ArrayHelper::remove($headerOptions, 'content');
          $headerTag = ArrayHelper::remove($headerOptions, 'tag', 'div');
  
          $bodyOptions = ArrayHelper::getValue($item, 'body', []);
          $bodyContent = ArrayHelper::remove($bodyOptions, 'content', []);
          $bodyTag = ArrayHelper::remove($bodyOptions, 'tag', 'div');
  
          if (!$headerContent && !$bodyContent) {
              return '';
          }
  
          $html[] = Html::beginTag('li', $itemOptions);
          if ($headerContent) {
              Html::addCssClass($headerOptions, ['header' => 'collapsible-header']);
              $html[] = Html::tag($headerTag, $headerContent, $headerOptions);
          }
          if ($bodyContent) {
              Html::addCssClass($bodyOptions, ['body' => 'collapsible-body']);
              $html[] = Html::tag($bodyTag, $bodyContent, $bodyOptions);
          }
          $html[] = Html::endTag('li');
  
          return implode("\n", $html);
      }
code_tokens: protected function renderItem ( $ item = [ ] ) { $ itemOptions = ArrayHelper :: getValue ( $ item , 'options' , [ ] ) ; $ headerOptions = ArrayHelper :: getValue ( $ item , 'header' , [ ] ) ; $ headerContent = ArrayHelper :: remove ( $ headerOptions , 'content' ) ; $ headerTag = ArrayHelper :: remove ( $ headerOptions , 'tag' , 'div' ) ; $ bodyOptions = ArrayHelper :: getValue ( $ item , 'body' , [ ] ) ; $ bodyContent = ArrayHelper :: remove ( $ bodyOptions , 'content' , [ ] ) ; $ bodyTag = ArrayHelper :: remove ( $ bodyOptions , 'tag' , 'div' ) ; if ( ! $ headerContent && ! $ bodyContent ) { return '' ; } $ html [ ] = Html :: beginTag ( 'li' , $ itemOptions ) ; if ( $ headerContent ) { Html :: addCssClass ( $ headerOptions , [ 'header' => 'collapsible-header' ] ) ; $ html [ ] = Html :: tag ( $ headerTag , $ headerContent , $ headerOptions ) ; } if ( $ bodyContent ) { Html :: addCssClass ( $ bodyOptions , [ 'body' => 'collapsible-body' ] ) ; $ html [ ] = Html :: tag ( $ bodyTag , $ bodyContent , $ bodyOptions ) ; } $ html [ ] = Html :: endTag ( 'li' ) ; return implode ( "\n" , $ html ) ; }
docstring: Render a single item.
  @param array $item the item configuration
  @return string the item's markup
docstring_tokens: Render a single item .