Renders a single data model.
public renderItem ( mixed $model, mixed $key, integer $index ) : string | ||
$model | mixed | the data model to be rendered |
$key | mixed | the key value associated with the data model |
$index | integer | the zero-based index of the data model in the model array returned by [[dataProvider]]. |
리턴 | string | the rendering result |
/** * 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 */ public function renderItem($model, $key, $index) { $dateLabel = $this->renderDateLabel($model); $icon = $this->renderIcon($model); $time = $this->renderTime($model); $itemBody = Html::tag('div', parent::renderItem($model, $key, $index), ['class' => 'timeline-body']); $itemHeader = $this->renderItemHeader($model); $itemFooter = $this->renderItemFooter($model); $item = Html::tag('div', $time . $itemHeader . $itemBody . $itemFooter, ['class' => 'timeline-item']); return $dateLabel . Html::tag('li', $icon . $item); }