uraankhayayaal/yii2-fileuploader

Yii2 file uploader

Installs: 100

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Language:CSS

Type:yii2-extension

v1.0.1 2022-07-26 11:58 UTC

This package is auto-updated.

Last update: 2024-11-11 06:12:39 UTC


README

Yii2 file uploader

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist uraankhayayaal/yii2-fileuploader "*"

or add

"uraankhayayaal/yii2-fileuploader": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

<?= \uraankhayayaal\fileuploader\widgets\input\WFileinput::widget([
    'model' => $model,
    'attribute' => 'files',
    'relationAttributeName' => 'directoryFiles',
    'action' => Url::toRoute(['/directory/directory/upload']),
    'model_attribute' => 'directory_id',
    'model_id' => $model->id,
]); ?>

On controller:

public function actions()
{
    return [
        ...
        'upload' => [
            'class' => \uraankhayayaal\fileuploader\actions\FileUplaodAction::className(),
            'fileModel' => \yourpath\to\Model::className(),
        ]
    ];
}