sadapon2008/simple-file-manager
最新稳定版本:0.1.1
Composer 安装命令:
composer require sadapon2008/simple-file-manager
包简介
SimpleFileManager For CakePHP + TinyMCE
关键字:
README 文档
README
Example
1. create upload directory
$ mkdir app/webroot/upload $ chmod a+w app/webroot/upload
2. load plugin
app/Config/bootstra.php:
CakePlugin::load('Migrations'); CakePlugin::load('BoostCake'); CakePlugin::load('SimpleFileManager', array('bootstrap' => true));
3. create database table
$ ./app/Console/cake Migrations.migration run all -p SimpleFileManager
4. example controller & view
app/Controller/PostsController:
<?php App::uses('AppController', 'Controller'); class PostsController extends AppController { public $uses = array('Post'); public $helpers = array('SimpleFileManager.SimpleFileManager'); public function index() { if($this->request->is('post') || $this->request->is('put')) { $this->Post->create(); $this->Post->save($this->request->data); } } }
app/View/Posts/index.ctp:
<?php $this->start('script'); ?> <script src="//code.jquery.com/jquery-1.11.2.min.js"></script> <script src="//tinymce.cachefly.net/4.1/tinymce.min.js"></script> <?php echo $this->SimpleFileManager->script(); ?> <script type="text/javascript"> $(function() { tinymce.init({ selector: 'textarea', plugins: ['image'], file_browser_callback: <?php echo $this->SimpleFileManager->getFileBrowserCallBack(); ?>, width: '620', height: '480', relative_urls : false }); }); </script> <?php $this->end(); ?> <?php echo $this->Form->create('Post'); ?> <?php echo $this->Form->input('content', array('type' => 'textarea')); ?> <?php echo $this->Form->end(); ?>
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-01-23