├── README.md ├── Webuploader.php ├── WebuploaderAsset.php └── composer.json /README.md: -------------------------------------------------------------------------------- 1 | YII2百度上传扩展 2 | ========== 3 | WebUploader是由Baidu WebFE(FEX)团队开发的一个简单的以HTML5为主,FLASH为辅的现代文件上传组件。 4 | 5 | Installation 6 | ------------ 7 | 8 | The preferred way to install this extension is through [composer](http://getcomposer.org/download/). 9 | 10 | Either run 11 | 12 | ``` 13 | php composer.phar require --prefer-dist wdteam/yii2-webuploader "*" 14 | ``` 15 | 16 | or add 17 | 18 | ``` 19 | "wdteam/yii2-webuploader": "*" 20 | ``` 21 | 22 | to the require section of your `composer.json` file. 23 | 24 | 25 | Usage 26 | ----- 27 | 28 | Once the extension is installed, simply use it in your code by : 29 | 30 | ```php 31 | ``` -------------------------------------------------------------------------------- /Webuploader.php: -------------------------------------------------------------------------------- 1 | savePath); 26 | if(!is_dir($savePath)) 27 | { 28 | if(!FileHelper::createDirectory($savePath)) 29 | { 30 | throw new InvalidCallException("上传目录无法创建!"); 31 | }; 32 | } 33 | 34 | 35 | } 36 | 37 | public function run() 38 | { 39 | $asset = WebuploaderAsset::register($this->view); 40 | 41 | return "Hello WindsDeng!"; 42 | } 43 | 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /WebuploaderAsset.php: -------------------------------------------------------------------------------- 1 |