public function renderItem($model, $key, $index)
    {
        if ($this->itemView === null) {
            $content = $key;
        } elseif (is_string($this->itemView)) {
            $content = $this->getView()->render($this->itemView, array_merge([
                'model' => $model,
                'key' => $key,
                'index' => $index,
                'widget' => $this,
            ], $this->viewParams));
        } else {
            $content = call_user_func($this->itemView, $model, $key, $index, $this);
        }
        $options = $this->itemOptions;
        $tag = ArrayHelper::remove($options, 'tag', 'div');
        if ($tag !== false) {
            $options['data-key'] = is_array($key) ? json_encode($key, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) : (string) $key;

            return Html::tag($tag, $content, $options);
        } else {
            return $content;
        }
    }
public function renderItem($model, $key, $index)
    {
        if ($this->itemView === null) {
            $content = $key;
        } elseif (is_string($this->itemView)) {
            $content = $this->getView()->render($this->itemView, array_merge([
                'model' => $model,
                'key' => $key,
                'index' => $index,
                'widget' => $this,
            ], $this->viewParams));
        } else {
            $content = call_user_func($this->itemView, $model, $key, $index, $this);
        }
        $options = $this->itemOptions;
        $tag = ArrayHelper::remove($options, 'tag', 'div');
        if ($tag !== false) {
            $options['data-key'] = is_array($key) ? json_encode($key, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) : (string) $key;

            return Html::tag($tag, $content, $options);
        } else {
            return $content;
        }
    }
public function renderItem ( $ model , $ key , $ index ) { if ( $ this -> itemView === null ) { $ content = $ key ; } elseif ( is_string ( $ this -> itemView ) ) { $ content = $ this -> getView ( ) -> render ( $ this -> itemView , array_merge ( [ 'model' => $ model , 'key' => $ key , 'index' => $ index , 'widget' => $ this , ] , $ this -> viewParams ) ) ; } else { $ content = call_user_func ( $ this -> itemView , $ model , $ key , $ index , $ this ) ; } $ options = $ this -> itemOptions ; $ tag = ArrayHelper :: remove ( $ options , 'tag' , 'div' ) ; if ( $ tag !== false ) { $ options [ 'data-key' ] = is_array ( $ key ) ? json_encode ( $ key , JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ) : ( string ) $ key ; return Html :: tag ( $ tag , $ content , $ options ) ; } else { return $ content ; } }
Renders a single data model.
@param mixed $model the data model to be rendered
@param mixed $key the key value associated with the data model
@param integer $index the zero-based index of the data model in the model array returned by [[dataProvider]].
@return string the rendering result
Renders a single data model .