Git Product home page Git Product logo

yii2-imperavi-widget's Introduction

Imperavi Redactor Widget for Yii 2 - Mod by NickGoodwind

Imperavi Redactor Widget is a wrapper for Imperavi Redactor 10.2.5, a high quality WYSIWYG editor.

Note that Imperavi Redactor itself is a proprietary commercial copyrighted software but since Yii community bought OEM license you can use it for free within Yii.

Install

The preferred way to install this extension is through composer.

Either run

$ php composer.phar require --prefer-dist vova07/yii2-imperavi-widget "*"

or add

"vova07/yii2-imperavi-widget": "*"

to the require section of your composer.json file.

Basic usage

For basic usage follow the intructions provided by vova07

CodeMirror usage

Simply add the following lines to your Redactor configuration

use vova07\imperavi\Widget;

echo $form->field($model, 'content')->widget(Widget::className(), [
    'settings' => [
        ...
        'codemirror' => true,
        'soure' => [
            'codemirror' => [
                'lineNubers' => true,
                'mode' => 'htmlmixed',
                'theme' => 'ayu-mirage',
                'indentWithTabs' => true,
                # Add all other codemirror options here.
            ]
        ],
        ...
    ],
]);

For all CodeMirror options review the manual

Custom modes, themes or assets

To use custom CodeMirror assets (modes, themes, plugins) other than the ones predefined here you need to add those assets to the codemirror assets folder src/assets/codemirror If you need to add a mode added to the modes folder; same with the themes. Just make sure to maintain the folder order. You can get all assets from CodeMirror.

After including the assets you need to update the CodemirrorAsset.php file:

class CodemirrorAsset extends AssetBundle
{
    public $sourcePath = '@vova07/imperavi/assets';
    
    public $js = [
        'codemirror/codemirror.js',
        # Add your modes and plugins here
    ];

    public $css = [
        'codemirror/codemirror.css',
        # Add your themes and styles here
    ];

    public $depends = [
        'app\modules\admin\assets\AdminAppAsset'
    ];
}

Further Information

Please, check the Imperavi Redactor v10 documentation for further information about its configuration options.

Contributing

Please see CONTRIBUTING for vova07 previous contributtor details. All changes staged in this fork have been done by NickgGoodwind

Credits

License

The BSD License (BSD). Please see License File for more information.

Upgrade guide

Please check the UPGRADE GUIDE for details.

yii2-imperavi-widget's People

Contributors

vova07 avatar nickgoodwind avatar maxmirazh33 avatar onmotion avatar silverfire avatar elisdn avatar jcvalerio avatar hamrak avatar marcovtwout avatar sensetivity avatar aaiyo avatar do6po avatar greeflas avatar bocceli avatar bscheshirwork avatar bzzim avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.