Commit 0a3f4e85 by Carsten Brandt

made grid\DataColumn::getDataCellValue() public

allow using it from the gridview directly
parent 7b908aa8
...@@ -28,6 +28,7 @@ Yii Framework 2 Change Log ...@@ -28,6 +28,7 @@ Yii Framework 2 Change Log
- Chg #3175: InvalidCallException, InvalidParamException, UnknownMethodException are now extended from SPL BadMethodCallException (samdark) - Chg #3175: InvalidCallException, InvalidParamException, UnknownMethodException are now extended from SPL BadMethodCallException (samdark)
- Chg: Replaced `clearAll()` and `clearAllAssignments()` in `yii\rbac\ManagerInterface` with `removeAll()`, `removeAllRoles()`, `removeAllPermissions()`, `removeAllRules()` and `removeAllAssignments()` (qiangxue) - Chg: Replaced `clearAll()` and `clearAllAssignments()` in `yii\rbac\ManagerInterface` with `removeAll()`, `removeAllRoles()`, `removeAllPermissions()`, `removeAllRules()` and `removeAllAssignments()` (qiangxue)
- Chg: Added `$user` as the first parameter of `yii\rbac\Rule::execute()` (qiangxue) - Chg: Added `$user` as the first parameter of `yii\rbac\Rule::execute()` (qiangxue)
- Chg: `yii\grid\DataColumn::getDataCellValue()` visibility is now `public` to allow accessing the value from a GridView directly (cebe)
2.0.0-beta April 13, 2014 2.0.0-beta April 13, 2014
......
...@@ -14,6 +14,10 @@ Upgrade from Yii 2.0 Beta ...@@ -14,6 +14,10 @@ Upgrade from Yii 2.0 Beta
* If you used `clearAll()` or `clearAllAssignments()` of `yii\rbac\DbManager`, you should replace * If you used `clearAll()` or `clearAllAssignments()` of `yii\rbac\DbManager`, you should replace
them with `removeAll()` and `removeAllAssignments()` respectively. them with `removeAll()` and `removeAllAssignments()` respectively.
* If you created RBAC rule classes, you should modify their `execute()` method by adding `$user` * If you created RBAC rule classes, you should modify their `execute()` method by adding `$user`
as the first parameter: `execute($user, $item, $params)`. The `$user` parameter represents as the first parameter: `execute($user, $item, $params)`. The `$user` parameter represents
the ID of the user currently being access checked. Previously, this is passed via `$params['user']`. the ID of the user currently being access checked. Previously, this is passed via `$params['user']`.
* If you override `yii\grid\DataColumn::getDataCellValue()` with visibility `protected` you have
to change visibility to `public` as visibility of the base method has changed.
...@@ -398,14 +398,13 @@ class Controller extends Component implements ViewContextInterface ...@@ -398,14 +398,13 @@ class Controller extends Component implements ViewContextInterface
* The [[render()]], [[renderPartial()]] and [[renderFile()]] methods will use * The [[render()]], [[renderPartial()]] and [[renderFile()]] methods will use
* this view object to implement the actual view rendering. * this view object to implement the actual view rendering.
* If not set, it will default to the "view" application component. * If not set, it will default to the "view" application component.
* @return View the view object that can be used to render views or view files. * @return View|\yii\web\View the view object that can be used to render views or view files.
*/ */
public function getView() public function getView()
{ {
if ($this->_view === null) { if ($this->_view === null) {
$this->_view = Yii::$app->getView(); $this->_view = Yii::$app->getView();
} }
return $this->_view; return $this->_view;
} }
......
...@@ -155,9 +155,13 @@ class DataColumn extends Column ...@@ -155,9 +155,13 @@ class DataColumn extends Column
} }
/** /**
* @inheritdoc * Returns the data cell value.
* @param mixed $model the data model
* @param mixed $key the key associated with the data model
* @param integer $index the zero-based index of the data model among the models array returned by [[GridView::dataProvider]].
* @return string the data cell value
*/ */
protected function getDataCellValue($model, $key, $index) public function getDataCellValue($model, $key, $index)
{ {
if ($this->value !== null) { if ($this->value !== null) {
if (is_string($this->value)) { if (is_string($this->value)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment