yii\jui\Selectable::renderItems PHP Method

renderItems() public method

Renders selectable items as specified on [[items]].
public renderItems ( ) : string
return string the rendering result.
    public function renderItems()
    {
        $items = [];
        foreach ($this->items as $item) {
            $options = $this->itemOptions;
            $tag = ArrayHelper::remove($options, 'tag', 'li');
            if (is_array($item)) {
                if (!array_key_exists('content', $item)) {
                    throw new InvalidConfigException("The 'content' option is required.");
                }
                $options = array_merge($options, ArrayHelper::getValue($item, 'options', []));
                $tag = ArrayHelper::remove($options, 'tag', $tag);
                $items[] = Html::tag($tag, $item['content'], $options);
            } else {
                $items[] = Html::tag($tag, $item, $options);
            }
        }
        return implode("\n", $items);
    }