schere软件 / cake-wiki
CakePHP应用的简单Wiki
v1.0.5
2016-11-17 14:05 UTC
README
这是一个为cakephp提供的简单插件,允许创建分层Wiki页面。
需求
- cake-attachments 用于管理Wiki页面的附件
- cake-FrontendBridge 用于轻松集成其他需要的js库
- cake-model-history 用于可历史记录的Wiki页面
- cake-cktools 用于如Wiki的链接分层结构等视图元素
- bootstrap 用于页面编辑菜单中的图标
安装
####1. 使用composer要求插件
$ composer require scherersoftware/cake-wiki
2. 使用composer包含插件
在项目文件夹中打开终端并运行以下命令
$ composer update
$ composer install
3. 在你的 config/bootstrap.php
中加载插件
Plugin::load('Scherersoftware/Wiki', ['bootstrap' => true, 'routes' => true]);
4. 在你的数据库中创建表 'wiki-pages'
此插件需要在你的项目数据库中创建额外的表。运行以下SQL查询以创建表。
CREATE TABLE `wiki_pages` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`parent_id` int(10) unsigned DEFAULT NULL,
`lft` int(10) DEFAULT NULL,
`rght` int(10) DEFAULT NULL,
`sort` int(3) unsigned DEFAULT NULL,
`title` varchar(255) DEFAULT NULL,
`content` mediumtext,
`status` varchar(255) NOT NULL DEFAULT 'active',
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
或者运行迁移:
bin/cake migrations migrate -p Scherersoftware/Wiki
有关更多信息,请参阅 'vendor/scherersoftware/cake-wiki/config/schma.php'
和 'config/wiki_pages.sql'
。
5. 使用FrontendBridge加载额外的JS文件
有其他方式包含所有需要的js文件,但我们强烈建议使用我们的FrontendBridge插件,因为如果你使用它,你只需要在你的'assets.ctp'
文件中添加以下行:
echo $this->FrontendBridge->getAppDataJs();
这会加载javascript文件,启用Ace Editor,这是用于编辑Wiki内容的UI的关键部分。
使用方法
根据您的需求配置访问权限,并让您的用户创建分层Wiki页面!