![]() Let's replace the standard text input field with Redactor. 'redactor' => 'yii\redactor\RedactorModule', In our web/config.php file, we'll add the module definition for Redactor. Installing yiidoc/yii2-redactor (2.0.0) Updating dependencies (including require-dev) Loading composer repositories with package information We'll begin by installing a Yii2 extension for Redactor ( yii2-redactor) using composer: Admins-MBP:hello Jeff$ composer require -prefer-dist yiidoc/yii2-redactor "*" You might also take a look at the tutorial I've written on Squire, an alternative, more lightweight rich text editor, which can also be integrated with Yii. With Yii2, you can install Redactor and integrate rich text editing into your forms in just a few minutes. It has an extremely clean and fast user interface, while also providing a platform for powerful extensions. It offers a JQuery API and has a wide set of plugins such as for image management, table formatting, and fullscreen editing.įortunately, the Yii community purchased an unlimited license to Redactor for any application built on the framework. Redactor is a powerful rich text editor created by Imperavi. I'm especially interested if you have different approaches or additional ideas, or if you want to suggest topics for future tutorials. Just a reminder, I do participate in the comment threads below. In this tutorial, I'm going to introduce you to using the rich text editor Redactor within the Yii Framework.įor these examples, we'll continue to imagine we're building a framework for posting simple status updates, e.g. In this Programming With Yii2 series, I'm guiding readers in use of the newly upgraded Yii2 Framework for PHP. If you're asking, "What's Yii?" check out my earlier tutorial: Introduction to the Yii Framework, which reviews the benefits of Yii and includes an overview of what's new in Yii 2.0, released in October 2014. ![]() Reference: Protect Your Uploads Folder with. 'uploadDir' => => You need to create uploads folder and chmod and set security for folder upload Or if you want to change the upload directory. ConfigureĪdd to config file (config/web.php or common\config\main.php) 'modules' => [ To the require section of your composer.json. The preferred way to install this extension is through composer.Įither run php composer.phar require -prefer-dist yiidoc/yii2-redactor "*" Original yiidoc/yii2-redactor Readme: Installation ![]() Integrated CFDan's clipboardPaste plugin and added clipboard upload action. ![]() Integrate Redactor-10-clipboardPaste-plugin 'class' => 'yii\redactor\RedactorModule', The guest user file path is still 'guest'. When set, this hides logged in user id's in file paths and uses a common folder for all logged in users. 'removePastedImagesMessage' => "Please upload images via filemanager or drag'n'drop",Īdditional config option added - authUserDir (default blank, allowed characters a-zA-Z0-9 only) removePastedImagesMessage (default blank)Īdditional option to tell users the correct way to upload images. removePastedImages (default false)Īdditional option to remove images pasted in to content (as base64 data) - less restrictive than pastePlainText. Changes English (UK) language added 'clientOptions' => [ Has not been published on packagelist yet. This version is a fork of yiidoc/yii2-redactor to allow some additionalįor install, replace "yiidoc/" with "stump90/" along with a repository if this ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |