if(UploadedFile::getInstance($model, 'avatar') != null)
{
$model->avatar= UploadedFile::getInstance($model, 'avatar');
$imageName = $model->avatar->basename.time();
$imageName =md5(md5($imageName));
if (file_exists($imageName.$model->avatar->extension)) {
unlink("uploads/avatars/".$imageName.$model->avatar->extension);
}
$model->avatar->saveAs('uploads/avatars/'.$imageName.'.'.$model->avatar->extension);
$model->avatar='uploads/avatars/'.$imageName.'.'.$model->avatar->extension;
}
else
{
$model->avatar='uploads/no_photo.png';
}
object(frontend\models\SignupForm)#77 (12) {
["username"]=>
string(7) "adminaa"
["email"]=>
string(8) "12@bk.ru"
["password"]=>
string(6) "123456"
["first_name"]=>
string(3) "132"
["second_name"]=>
string(3) "aaa"
["avatar"]=>
NULL
["_errors":"yii\base\Model":private]=>
NULL
["_validators":"yii\base\Model":private]=>
object(ArrayObject)#88 (1) {
["storage":"ArrayObject":private]=>
array(14) {
[0]=>