yii2-plupload
Plupload Widget for Yii2
uses moxiecode/plupload, (*1)
Installation
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist alexgivi/yii2-plupload-widget "*"
or add, (*4)
"alexgivi/yii2-plupload-widget": "*"
to the require section of your composer.json
file., (*5)
Usage
Once the extension is installed, simply use it in your code by :, (*6)
<?= \alexgivi\plupload\Plupload::widget([
'url' => ['controller/test-upload'],
]); ?>
In the controller:, (*7)
class Controller extends yii\web\Controller
{
public function actionTestUpload()
{
$file = UploadedFile::getInstanceByName('file');
// perform file save.
}
}