froala/wysiwyg-cake
最新稳定版本:v5.2.0
Composer 安装命令:
composer require froala/wysiwyg-cake
包简介
A beautiful WYSIWYG text editor based on HTML5 technology. Cross browser, with mobile support, high performance and Retina Ready modern design.
关键字:
README 文档
README
CakePHP Plugin for Froala Javascript WYSIWYG Text Editor. For CakePHP >=3.0.
See froala/wysiwyg-cake2 for CakePHP version 2.
About
The purpose of placing Froala WYSIWYG Editor in a plugin is to keep it separate from a themed view, the regular webroot or the app in general, which makes it easier to update and overall follows the idea of keeping the code clean and modular.
Installation
To use Froala WYSIWYG Editor you need to clone git repository:
git clone git://github.com/froala/wysiwyg-cake.git Plugin/Froala
Or if your CakePHP application is setup as a git repository, you can add it as a submodule:
git submodule add git://github.com/froala/wysiwyg-cake.git Plugin/Froala
Or open terminal/command prompt (windows) type composer require froala/wysiwyg-cake
Alternatively, you can download an archive from the master branch on Github and extract the contents to Froala plugin.
Make sure that you load the plugin routes by adding to your bootstrap file(bootstrap.php) in config folder:
Plugin::loadAll(); or Plugin::load('Froala'); This will load all plugins at once or only the Froala plugin.
Usage
The Froala helper is basically just a convenience helper that allows you to use php and CakePHP conventions to generate the configuration for Froala and as an extra it allows you to load configs.
// Loads Froala Editor javascript also will load all the plugins and css for the plugins <?= $this->Froala->plugin();?> // Will target one specific html selector on which the editor will be init. // Second paramenter is mix can be array/object of options that the Froala Editor will take. <?= $this->Froala->editor('#froala', array('option' => value));?>
How to use the helper
Since CakePHP 3.0 it is necessary to activate the plugin in your application. To do so,
edit app/Config/bootstrap.php and add the line CakePlugin::load('Froala'); at the
bottom. If you already have CakePlugin::loadAll(); to auto-load all plugins then you may skip this step.
Wherever you want to use it, load it in the controller
open AppController.php (your project/src/controller/AppController) Declare variable public $helpers = array('Froala.Froala');
class AppController extends Controller { ... public $helpers = array('Froala.Froala'); ... }
In the view page (template) add
<?= $this->Froala->editor('#froala-editor'');?>
This is a simple init example with no options for the Froala Editor. Include the below statement in your view template to integrate the plugins in your editor
$this->Froala->plugin(); $this->Froala->editor('selector');
This will instruct Froala to convert the matched element on the page to Froala editor.
A complete list of Froala configuration options are on the website.
Default options
If you want a quick way to configure default values for all the Froala Editors of an application, you could use the 'Froala.editorOptions' configuration.
Here is an example of a line you could have in bootstrap.php:
Configure::write('Froala.editorOptions', array('height' => '300px'));
It will make all editors to have a 300px height and apply line braker tags. You may want to override this value for a single editor. To do so, just pass the option to the editor() method and it will override the default value.
Usage examples
Example of init using array of options
// '#comment' Represents the html element selector. // 'array()' Represents the list of options that are passed to the editor. $this->Froala->editor('#comment', array('minHeight => '200px', 'maxHeight' => '400px'));
Requirements
- PHP version: PHP 5.2+
License
The CakePHP Froala WYSIWYG Editor project is under MIT license. However, in order to use WordPress Froala WYSIWYG Editor plugin you should purchase a license for it.
Froala Editor has 3 different licenses for commercial use. For details please see License Agreement.
froala/wysiwyg-cake 适用场景与选型建议
froala/wysiwyg-cake 是一款 基于 CSS 开发的 Composer 扩展包,目前已累计 11.19k 次下载、GitHub Stars 达 9, 最近一次更新时间为 2014 年 09 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「text」 「javascript」 「wysiwyg」 「editor」 「html」 「rte」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 froala/wysiwyg-cake 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 froala/wysiwyg-cake 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 froala/wysiwyg-cake 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
Generates a Blade directive exporting all of your named Laravel routes. Also provides a nice route() helper function in JavaScript.
Caching and compression for Twig assets (JavaScript and CSS).
A pretty nice way to expose your translation messages to your JavaScript.
Common libraries used by Zimbra Api
PHP client for the Google Closure Compiler API in one file.
统计信息
- 总下载量: 11.19k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2014-09-11