spescina/mediabrowser
Composer 安装命令:
composer require spescina/mediabrowser
包简介
Laravel packages that provide a basic user interface for browsing a server folder, for uploading files and for picking a file
README 文档
README
MediaBrowser
Laravel 5.2 package that provide a basic user interface for browsing a server folder, for uploading files and for picking a file
Install && Usage
Run composer require spescina/mediabrowser
Add the service provider in the config/app.php file
Spescina\Mediabrowser\Providers\MediabrowserServiceProvider::class
Publish the package assets running php artisan vendor:publish
Mediabrowser uses Fancybox as IFrame popup loader and for this reason requires jQuery.
Include in your template files Mediabrowser stylesheets
<link media="all" type="text/css" rel="stylesheet" href="http://localhost/packages/spescina/mediabrowser/dist/mediabrowser-include.min.css">
and scripts
<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline --> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script src="http://localhost/packages/spescina/mediabrowser/dist/mediabrowser-include.min.js"></script>
Now you have to insert an input field and a button for the fancybox trigger, for example
<input type="text" name="yourfield" value="uploads/image.jpg" class="form-control" /> <span class="input-group-btn"> <a data-fancybox-type="iframe" href="{{ route('mediabrowser', array('yourfield', 'uploads/image.jpg')) }}" class="btn btn-default mediabrowser-js" type="button"><span class="glyphicon glyphicon-folder-open"></span></a> </span>
Notes
- The library url can be generated through the
mediabrowsernamed route. It accepts two parameters, field name and optionally the selected value. - Mediabrowser is configured for loading optimized assets when your laravel application is not in debug mode.
统计信息
- 总下载量: 574
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2014-04-11
