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);
    }
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);
    }
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 ) ; }
Render a single item.
@param array $item the item configuration
@return string the item's markup
Render a single item .