rezident / yii2-attach-file
这个yii2扩展允许您将不同的上传文件附加到模型上,并在不同的视图中表示这些文件
0.9.14
2017-04-15 17:03 UTC
Requires
- phpunit/phpunit: ^5.7
- yiisoft/yii2: ^2.0
README
这个yii2扩展允许您将不同的上传文件附加到模型上。该扩展尚未完成!它不起作用!版本0.9适用于在实际项目中测试。
配置
要使用此扩展,只需在您的应用程序配置中添加以下代码
return [ //..... 'modules' => [ //..... 'attach_file' => [ 'class' => rezident\attachfile\AttachFileModule::class, 'originalsPath' => '@app/files/originals', 'viewsPath' => '@app/files/views', 'webPath' => '@app/files/views' ] ] ];
用法
将行为添加到模型
要将行为添加到模型,您必须
public function behaviors() { return [ 'specified' => [ 'class' => rezident\attachfile\behaviors\AttachFileBehavior::class, 'modelKey' => 'specified' // If it is not specified, will be used the short name of the model class ] ]; }