frknikiz / laravel-quick-elfinder
Laravel Quick Elfinder 包允许您快速使用 Elfinder。
1.1
2015-08-03 09:41 UTC
Requires
- php: >=5.4.0
- barryvdh/laravel-elfinder: 0.2.*
- illuminate/support: 4.2.*
This package is not auto-updated.
Last update: 2024-09-28 18:21:20 UTC
README
Laravel Quick Elfinder 包允许您快速使用 Elfinder。
此包仅适用于 Laravel 4.*
库功能
- 使用 Laravel Elfinder 包
- 快速、简单、无需配置
安装
首先通过 Composer 安装此包。编辑您的项目 composer.json 文件
"require": {
"frknikiz/laravel-quick-elfider":"dev-master"
}
或者从终端安装 Composer
composer require frknikiz/laravel-quick-elfinder
然后,从终端更新 Composer
composer update
打开 app/config/app.php
,并将新项添加到 providers 数组中。
'Frknikiz\CustomElfinder\CustomElfinderServiceProvider'
从终端发布 Elfinder 配置
php artisan cfinder:pub
访问名为 "isAdminLogin" 的安全选项,您必须定义一个过滤器。
从终端发布 Elfinder 资产
php artisan elfinder:publish
最后,从终端发布 Quick Elfinder 资产
php artisan asset:publish frknikiz/laravel-quick-elfinder
用法
在您想要使用的视图文件中,在调用 jQuery 文件后调用 Cutil::getjs()
方法
示例
<div>
<input type="text" name="path" disabled/>
<button class="find">Add İmage</button>
<button class="remove">Remove İmage</button>
</div>
<div>
<input type="text" name="path" disabled/>
<button class="find">Add İmage</button>
<button class="remove">Remove İmage</button>
</div>
...
{{HTML::script('jquery.min.js')}}
{{Cutil::getJs()}}
在上面的示例中,当您点击 "find" 类的实例时,elfinder 视图将出现。选择您的图像源后,图像 URL 将放置在输入框中。
"find" 类:打开 Elfinder 窗口
"remove" 类:清除输入
事件
imageSelected:选择图片后触发。
$(document).on('imageSelected', function (e, data)
{
alert("Image Selected !!!"+data.path);
});
参考
许可证
Copyright 2015 Furkan İKİZ.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://apache.ac.cn/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.