From 8ff4f6648e77a6855276e4bf33693d06b19bf82d Mon Sep 17 00:00:00 2001 From: hetao Date: Sat, 12 Oct 2019 09:35:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=87=E6=97=B6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-ZH-CN.md | 6 +++--- README.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README-ZH-CN.md b/README-ZH-CN.md index d6e9848..44e98c5 100644 --- a/README-ZH-CN.md +++ b/README-ZH-CN.md @@ -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 这个扩展会自动上传文件并填充指定的属性值和上传文件的名称。 @@ -141,7 +141,7 @@ class User extends ActiveRecord { return [ [ - 'class' => \haohetao\file\UploadImageBehavior::className(), + 'class' => \haohetao\file\UploadImageBehavior::class, 'attributes' => [ [ 'attribute' => 'image', @@ -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, diff --git a/README.md b/README.md index bcc66d2..d180635 100644 --- a/README.md +++ b/README.md @@ -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}',