mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 05:48:11 +08:00
Fixes #4911: Changed callback signature used in yii\base\ArrayableTrait::fields() from function ($field, $model) { to function ($model, $field) {
This commit is contained in:
@ -247,6 +247,7 @@ Yii Framework 2 Change Log
|
|||||||
- Chg #4586: Signed bigint and unsigned int will be converted into integers when they are loaded from DB by AR (qiangxue)
|
- Chg #4586: Signed bigint and unsigned int will be converted into integers when they are loaded from DB by AR (qiangxue)
|
||||||
- Chg #4591: `yii\helpers\Url::to()` will no longer prefix relative URLs with the base URL (qiangxue)
|
- Chg #4591: `yii\helpers\Url::to()` will no longer prefix relative URLs with the base URL (qiangxue)
|
||||||
- Chg #4595: `yii\widgets\LinkPager`'s `nextPageLabel`, `prevPageLabel`, `firstPageLabel`, `lastPageLabel` are now taking `false` instead of `null` for "no label" (samdark)
|
- Chg #4595: `yii\widgets\LinkPager`'s `nextPageLabel`, `prevPageLabel`, `firstPageLabel`, `lastPageLabel` are now taking `false` instead of `null` for "no label" (samdark)
|
||||||
|
- Chg #4911: Changed callback signature used in `yii\base\ArrayableTrait::fields()` from `function ($field, $model) {` to `function ($model, $field) {` (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)
|
- Chg: `yii\grid\DataColumn::getDataCellValue()` visibility is now `public` to allow accessing the value from a GridView directly (cebe)
|
||||||
|
|||||||
@ -206,3 +206,6 @@ new ones save the following code as `convert.php` that should be placed in the s
|
|||||||
- `sendContentAsFile($content, $attachmentName, $options = [])`
|
- `sendContentAsFile($content, $attachmentName, $options = [])`
|
||||||
- `sendStreamAsFile($handle, $attachmentName, $options = [])`
|
- `sendStreamAsFile($handle, $attachmentName, $options = [])`
|
||||||
- `xSendFile($filePath, $attachmentName = null, $options = [])`
|
- `xSendFile($filePath, $attachmentName = null, $options = [])`
|
||||||
|
|
||||||
|
* The signature of callbacks used in `yii\base\ArrayableTrait::fields()` is changed from `function ($field, $model) {`
|
||||||
|
to `function ($model, $field) {`.
|
||||||
|
|||||||
@ -35,7 +35,7 @@ trait ArrayableTrait
|
|||||||
* returning the corresponding field value. The signature of the callable should be:
|
* returning the corresponding field value. The signature of the callable should be:
|
||||||
*
|
*
|
||||||
* ```php
|
* ```php
|
||||||
* function ($field, $model) {
|
* function ($model, $field) {
|
||||||
* // return field value
|
* // return field value
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
@ -118,7 +118,7 @@ trait ArrayableTrait
|
|||||||
{
|
{
|
||||||
$data = [];
|
$data = [];
|
||||||
foreach ($this->resolveFields($fields, $expand) as $field => $definition) {
|
foreach ($this->resolveFields($fields, $expand) as $field => $definition) {
|
||||||
$data[$field] = is_string($definition) ? $this->$definition : call_user_func($definition, $field, $this);
|
$data[$field] = is_string($definition) ? $this->$definition : call_user_func($definition, $this, $field);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this instanceof Linkable) {
|
if ($this instanceof Linkable) {
|
||||||
|
|||||||
Reference in New Issue
Block a user