承接 leammas/yii2-flowjs 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

leammas/yii2-flowjs

Composer 安装命令:

composer require leammas/yii2-flowjs

包简介

Easy to use widget and controller for adding HTML5 fully customizable file upload to your app

README 文档

README

Easy to use widget and controller for adding HTML5 fully customizable file upload to your app

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist leammas/yii2-flowjs "*"

or add

"leammas/yii2-flowjs": "*"

to the require section of your composer.json file.

Usage

Widget

Add the widget with corresponding settings in your view. For more insight about settings and restrictions @see FlowJsWidget.php. Don't forget to add target setting containing url to FlowJsController Upload action (see below).

<?= \leammas\yii2\flowjs\FlowJsWidget::widget([
    'clientOptions' => ['target' => "'" . Url::to(['/upload']) . "'"],
    'eventHandlers' => [],
    'options' => ['class' => 'btn btn-default', 'id' => 'flow_button'],
    'targetTag' => 'button',
    'targetContent' => 'Upload!'
]); ?>

Module

To save files uploaded by the widget, you should register this extension as an application module in your web.php:

'modules' => [
    ...
    'flowjs' => 'leammas\yii2\flowjs\FlowJs'
],

After that you may check that the handler runs properly by accessing http://your.app/flowjs/flow-js/upload (this url suitable for activated enablePrettyUrl and deactivated showScriptName options, adjust to your needs). It should return 204 No Content response.

Also you may specify your own url in UrlManager

'urlManager' => [
    ...
    'rules' => [
        ...
        'upload' => 'flowjs/flow-js/upload'
    ]
],

Known issues

  1. CSRF validation for upload disabled.
  2. You can't pass attributes parameter to assign methods. @see https://github.com/flowjs/flow.js#methods
  3. Passing files with drag-n-drop is not working.

统计信息

  • 总下载量: 2.76k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-03