rezident / yii2-attach-file
This extension for yii2 allows you to attach different uploaded files to models and to represent ones in the different views
Installs: 32
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- phpunit/phpunit: ^5.7
- yiisoft/yii2: ^2.0
README
This extension for yii2 allows you to attach different uploaded files to models. The extension is not done! It does not work! Version 0.9 for testing in the real project.
Configuration
To use this extension, simply add the following code in your application configuration:
return [ //..... 'modules' => [ //..... 'attach_file' => [ 'class' => rezident\attachfile\AttachFileModule::class, 'originalsPath' => '@app/files/originals', 'viewsPath' => '@app/files/views', 'webPath' => '@app/files/views' ] ] ];
Usage
Adding behavior to the model
To adding behavior to the model you have to
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 ] ]; }