Docs regarding Security component usage updated.

This commit is contained in:
Klimov Paul
2014-06-27 14:33:20 +03:00
parent 2bab6259d1
commit 63c7a4cfca
9 changed files with 11 additions and 20 deletions

View File

@@ -69,18 +69,16 @@ After you set all needed fields in callback, you need to return $fixture array b
Another example of valid template:
```php
use yii\helpers\Security;
return [
'name' => 'firstName',
'phone' => 'phoneNumber',
'city' => 'city',
'password' => function ($fixture, $faker, $index) {
$fixture['password'] = Security::generatePasswordHash('password_' . $index);
$fixture['password'] = Yii::$app->getSecurity()->generatePasswordHash('password_' . $index);
return $fixture;
},
'auth_key' => function ($fixture, $faker, $index) {
$fixture['auth_key'] = Security::generateRandomKey();
$fixture['auth_key'] = Yii::$app->getSecurity()->generateRandomKey();
return $fixture;
},
];