Browse Source

#10631: added changelog, simpified code a bit more

tags/2.0.8
Alexander Makarov 9 years ago
parent
commit
9f45a94661
  1. 1
      framework/CHANGELOG.md
  2. 7
      framework/grid/DataColumn.php

1
framework/CHANGELOG.md

@ -51,6 +51,7 @@ Yii Framework 2 Change Log
- Enh #10451: Check of existence of `$_SERVER` in `\yii\web\Request` before using it (quantum13)
- Enh #10487: `yii\helpers\BaseArrayHelper::index()` got a third parameter `$groupBy` to group the input array by the key in one or more dimensions (quantum13, silverfire, samdark)
- Enh #10610: Added `BaseUrl::$urlManager` to be able to set URL manager used for creating URLs (samdark)
- Enh #10631: Splitted gettng label and rendering cell in `yii\grid\DataColumn::renderHeaderCellContent()` to make code simpler (t-kanstantsin, samdark)
- Enh #10764: `yii\helpers\Html::tag()` and `::beginTag()` return content without any HTML when the `$tag` attribute is `false` or `null` (pana1990)
- Enh #10840: Added `yii\console\Controller::optionAliases()` method to support aliases for commands (pana1990)
- Enh #10889: Allows unsigned primary key column definitions (df2)

7
framework/grid/DataColumn.php

@ -118,12 +118,15 @@ class DataColumn extends Column
}
$label = $this->getHeaderCellLabel();
if ($this->encodeLabel) {
$label = Html::encode($label);
}
if ($this->attribute !== null && $this->enableSorting &&
($sort = $this->grid->dataProvider->getSort()) !== false && $sort->hasAttribute($this->attribute)) {
return $sort->link($this->attribute, array_merge($this->sortLinkOptions, ['label' => ($this->encodeLabel ? Html::encode($label) : $label)]));
return $sort->link($this->attribute, array_merge($this->sortLinkOptions, ['label' => $label]));
} else {
return $this->encodeLabel ? Html::encode() : $label;
return $label;
}
}

Loading…
Cancel
Save