seguce92/filemanager

laravel 框架的 tinyMCE 文件管理器集成器。

安装: 29

依赖: 0

建议者: 0

安全: 0

星标: 1

关注者: 3

分支: 0

公开问题: 0

语言:JavaScript

v1.3.6 2019-06-25 02:24 UTC

This package is auto-updated.

Last update: 2024-09-28 01:57:15 UTC


README

安装

Laravel 5.x

您可以通过 Composer 为您的 Laravel 5 项目安装此软件包。

$ composer require seguce92/filemanager

如果 Laravel 版本为 <= 5.4,请在 app/config/app.php 中注册服务提供者数组。

Seguce92\Filemanager\ServiceProvider::class,

您可以选择使用外观来缩短代码。将以下内容添加到数组 aliases 中的您的外观中

'Filemanager' => Seguce92\Filemanager\FileManagerFacade::class,

使用命令导出设置文件和资源

$ php artisan vendor:publish

配置

要开始使用文件管理器,请在文件 app\config\seguce92\filemanager.php 中进行相应的配置。

    /**
     * PATH GLOBAL FILEMANAGER EMBED IN TINYMCE EDITOR
     * --------------------------------------------------------------
     *  Path filemanager resources
     */
    'filemanager' => '/filemanager/',

    /**
     * TITLE MODAL DIALOG
     * --------------------------------------------------------------
     *  Title of the modal dialog
     */
    'filemanager_title' => 'FileManager for Laravel with tinymce',

    /**
     * ROUTE OR URL
     * --------------------------------------------------------------
     *  Route or url
     */
    'url'	=>	'admin/filemanager/',

    /**
     * SINGLE IMPUT
     * --------------------------------------------------------------
     *  Single file manager charge in modal dialog
     */
    'single_filemanager'	=>	'filemanager/dialog.php?type=1&amp;field_id=image-filemanager&amp;relative_url=1',

    /**
     * FRAMEWORK STYLE
     * --------------------------------------------------------------
     * Select a use framework style (bootstrap, materializecss)
     */
    'style' =>  'bootstrap',

    /**
     * CUSTOM ICONS
     * --------------------------------------------------------------
     *  Custom icons relative style
     */
    'icons' => [
        'bootstrap' =>  [
            'select'    =>  'glyphicon glyphicon-picture',
            'clear' =>  'glyphicon glyphicon-trash'
        ],

        'materializecss'    =>  [
            'select'    =>  'photo',
            'clear' =>  'delete'
        ]
    ],

使用

添加样式

{!! Filemanager::style() !!}

添加脚本

{!! Filemanager::script() !!}

嵌入到 TinyMCE 4 编辑器中

  1. 首先添加样式和脚本指令

  2. 在内容部分使用指令

    {!! Filemanager::textarea('title for label') !!}
  3. 在脚本部分使用指令

    {!! Filemanager::tinymce() !!}

带有对话框响应式文件管理器的单个输入

  1. 首先添加样式和脚本指令

  2. 在内容部分使用指令

    {!! Filemanager::input('title for label') !!}

示例

@extends('layouts.app')

@section('style')
    {!! Html::style('path/to/bootstrap.min.css') !!}
    {!! Filemanager::style() !!}
@endsection

@section('content')
    <div class="row">
        <div class="col-md-10 col-md-offset-1">
            <div class="form-group">
                <label for="title">title</label>
                <input type="text" name="title" id="title" class="form-control">
            </div>
            {!! Filemanager::textarea('content') !!}

            {!! Filemanager::input('image') !!}

            <div class="form-group">
                <a href="{{ url('/') }}" class="btn btn-danger">CANCEL</a>
                <button type="submit" class="btn btn-success">SAVE</button>
            </div>
        </div>
    </div>
@endsection

@section('script')
    {!! Html::style('path/to/jquery.min.js') !!}
    {!! Html::style('path/to/bootstrap.min.css') !!}
    {!! Filemanager::script() !!}
    {!! Filemanager::tinymce() !!}
@endsection

信息和详情

访问网站 mascodigo.net