2017 © Pedro Peláez
 

library php-kind-editor-file-manage

KindEditor编辑器 php 文件/图片 管理类,用于编辑器的在线浏览文件功能

image

hwl/php-kind-editor-file-manage

KindEditor编辑器 php 文件/图片 管理类,用于编辑器的在线浏览文件功能

  • Friday, December 25, 2015
  • by williamWong
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

PHP KindEditor 编辑器文件管理类

用于编辑器浏览文件/图片的功能;管理后台上传文件,如图片;, (*1)

程序使用

代码示例:(可查看tests/testAssets)
, (*2)

<?php
    //网站根目录,绝对位置,这个绝对位置一定要将windows的路径分隔符 '\' 转为 '/' 才能正常使用
    $siteRoot  = str_replace('\\','/',realpath(dirname(__DIR__))) . '/';
    //网站URL根目录,相对于域名,如果没有子目录,则留空
    $urlRoot   = '';
    //设置的文件根目录,比如Image在/upload/images
    $rootPath  = $siteRoot . 'testAssets/images';
    $kem = new KindEditorImageFileManage($siteRoot,$urlRoot,$rootPath);

    //设置浏览路径,即前端浏览到的目录路径,相对于设置文件根目录
    $kem->setVisitDirPath('/');
    //获取前端需要的数据,数组格式
    $result = $kem->getResult(true)
    //前端需要的数据为json的字符串,由使用该类的进行转换并输出
    //echo json_encode($result); 
?>

单元测试

#cmd run
cd tests
phpunit --bootstrap bootstrap.php targetTestFile.php

The Versions

25/12 2015

dev-master

9999999-dev

KindEditor编辑器 php 文件/图片 管理类,用于编辑器的在线浏览文件功能

  Sources   Download

MIT

The Requires

  • php >= 5.3

 

by Avatar williamWong