"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "framework/UPGRADE.md" between
yii2-2.0.35.tar.gz and yii2-2.0.36.tar.gz

About: Yii 2 is a high-performance component-based PHP framework for developing large-scale Web applications (source).

UPGRADE.md  (yii2-2.0.35):UPGRADE.md  (yii2-2.0.36)
skipping to change at line 54 skipping to change at line 54
any restrictions. any restrictions.
After upgrading you should check whether your application still works as expecte d and no tests are broken. After upgrading you should check whether your application still works as expecte d and no tests are broken.
See the following notes on which changes to consider when upgrading from one ver sion to another. See the following notes on which changes to consider when upgrading from one ver sion to another.
> Note: The following upgrading instructions are cumulative. That is, > Note: The following upgrading instructions are cumulative. That is,
if you want to upgrade from version A to version C and there is if you want to upgrade from version A to version C and there is
version B between A and C, you need to follow the instructions version B between A and C, you need to follow the instructions
for both A and B. for both A and B.
Upgrade from Yii 2.0.35
-----------------------
* Inline validator signature has been updated with 4th parameter `current`:
```php
/**
* @param mixed $current the currently validated value of attribute
*/
function ($attribute, $params, $validator, $current)
```
* Behavior of inline validator used as a rule of `EachValidator` has been change
d - `$attribute` now refers to original
model's attribute and not its temporary counterpart:
```php
public $array_attribute = ['first', 'second'];
public function rules()
{
return [
['array_attribute', 'each', 'rule' => ['customValidatingMethod']],
];
}
public function customValidatingMethod($attribute, $params, $validator, $curre
nt)
{
// $attribute === 'array_attribute' (as before)
// now: $this->$attribute === ['first', 'second'] (on every iteration)
// previously:
// $this->$attribute === 'first' (on first iteration)
// $this->$attribute === 'second' (on second iteration)
// use now $current instead
// $current === 'first' (on first iteration)
// $current === 'second' (on second iteration)
}
```
* If you have any controllers that override the `init()` method, make sure they
are calling `parent::init()` at
the beginning, as demonstrated in the [component guide](https://www.yiiframewo
rk.com/doc/guide/2.0/en/concept-components).
Upgrade from Yii 2.0.32 Upgrade from Yii 2.0.32
----------------------- -----------------------
* `yii\helpers\ArrayHelper::filter` now correctly filters data when passing a fi lter with more than 2 "levels", * `yii\helpers\ArrayHelper::filter` now correctly filters data when passing a fi lter with more than 2 "levels",
e.g. `ArrayHelper::filter($myArray, ['A.B.C']`. Until Yii 2.0.32 all data afte r the 2nd level was returned, e.g. `ArrayHelper::filter($myArray, ['A.B.C']`. Until Yii 2.0.32 all data afte r the 2nd level was returned,
please see the following example: please see the following example:
```php ```php
$myArray = [ $myArray = [
'A' => 1, 'A' => 1,
 End of changes. 1 change blocks. 
0 lines changed or deleted 47 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)