Skip to content

Commit

Permalink
修改过时代码
Browse files Browse the repository at this point in the history
  • Loading branch information
haohetao committed Oct 12, 2019
1 parent a8a6d89 commit 8ff4f66
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README-ZH-CN.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Upload behavior for Yii 2 [English](https://github.com/haohetao/yii2-upload-behavior/blob/master/README.md)
===========================

注意: 参考项目 https://github.com/mongosoft/yii2-upload-behavior
注意: 参考项目 https://github.com/phpyii/yii2-upload-behavior

这个扩展会自动上传文件并填充指定的属性值和上传文件的名称。

Expand Down Expand Up @@ -141,7 +141,7 @@ class User extends ActiveRecord
{
return [
[
'class' => \haohetao\file\UploadImageBehavior::className(),
'class' => \haohetao\file\UploadImageBehavior::class,
'attributes' => [
[
'attribute' => 'image',
Expand Down Expand Up @@ -237,7 +237,7 @@ class User extends ActiveRecord
配置如下

```php
$form->field($model, 'image')->widget(FileInput::classname(), [
$form->field($model, 'image')->widget(FileInput::class, [
'options' => [
'accept' => 'image/*',
'multiple' => true,
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,14 @@ class Track extends ActiveRecord
{
public function getArtist()
{
return $this->hasOne(Artist::className(), [ 'id' => 'id_artist' ]);
return $this->hasOne(Artist::class, [ 'id' => 'id_artist' ]);
}
public function behaviors()
{
return [
[
'class' => UploadBehavior::className(),
'class' => UploadBehavior::class,
'attribute' => 'image',
'scenarios' => ['default'],
'path' => '@webroot/uploads/{artist.slug}',
Expand Down

0 comments on commit 8ff4f66

Please sign in to comment.