skeeks/yii2-ajax-file-upload

Yii2 files upload

Installs: 4 303

Dependents: 2

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 0

Language:JavaScript

Type:yii2-extension

2.0.0.3 2024-09-05 07:52 UTC

README

Latest Stable Version Total Downloads

Installation

Either run

php composer.phar require --prefer-dist skeeks/yii2-ajax-file-upload "*"

or add

"skeeks/yii2-ajax-file-upload": "*"

Configuration web app

'modules' => 
[
    'ajaxfileupload' => [
        'class'         => 'skeeks\yii2\ajaxfileupload\AjaxFileUploadModule',
    
        'controllerMap' => [
            'upload' => [
                'class'                 => 'skeeks\yii2\ajaxfileupload\controllers\UploadController',
                'private_tmp_dir'       => '@runtime/ajaxfileupload',
            ]
        ]
    ]
]

Configuration console app

'modules' => 
[
    'ajaxfileupload' => [
        'class'                 => 'skeeks\yii2\ajaxfileupload\AjaxFileUploadModule',
        'controllerNamespace'   => 'skeeks\yii2\ajaxfileupload\console\controllers'
    
        'controllerMap' => [
            'upload' => [
                'class'                 => '\skeeks\yii2\ajaxfileupload\controllers\UploadController',
                'private_tmp_dir'       => '@runtime/ajaxfileupload',
            ]
        ]
    ]
]

Console commands

php yii ajaxfileupload/cleanup

Usage

echo $form->field($model, 'image_src')->widget(
            \skeeks\yii2\ajaxfileupload\widgets\AjaxFileUploadWidget::class,
            [
                'accept' => 'image/*',
                //'view_file' => '@skeeks/yii2/ajaxfileupload/widgets/views/buttons',
                //'itemOptions' => [
                //    'class' => 'col-lg-6 col-md-6 col-sm-6 sx-file sx-state-success'
                //]
            ]
        );

Links

skeeks! SkeekS CMS (Yii2) — quickly, easily and effectively!
skeeks.com | cms.skeeks.com