protected function renderAttribute($attribute, $index)
    {
        if (is_string($this->template)) {
            return strtr($this->template, [
                '{label}' => $attribute['label'],
                '{value}' => $this->formatter->format($attribute['value'], $attribute['format']),
            ]);
        } else {
            return call_user_func($this->template, $attribute, $index, $this);
        }
    }
protected function renderAttribute($attribute, $index)
    {
        if (is_string($this->template)) {
            return strtr($this->template, [
                '{label}' => $attribute['label'],
                '{value}' => $this->formatter->format($attribute['value'], $attribute['format']),
            ]);
        } else {
            return call_user_func($this->template, $attribute, $index, $this);
        }
    }
protected function renderAttribute ( $ attribute , $ index ) { if ( is_string ( $ this -> template ) ) { return strtr ( $ this -> template , [ '{label}' => $ attribute [ 'label' ] , '{value}' => $ this -> formatter -> format ( $ attribute [ 'value' ] , $ attribute [ 'format' ] ) , ] ) ; } else { return call_user_func ( $ this -> template , $ attribute , $ index , $ this ) ; } }
Renders a single attribute.
@param array $attribute the specification of the attribute to be rendered.
@param integer $index the zero-based index of the attribute in the [[attributes]] array
@return string the rendering result
Renders a single attribute .