2017 © Pedro Peláez
 

yii2-extension yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

image

vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  • Friday, June 22, 2018
  • by vova07
  • Repository
  • 24 Watchers
  • 214 Stars
  • 186,845 Installations
  • JavaScript
  • 78 Dependents
  • 2 Suggesters
  • 83 Forks
  • 5 Open issues
  • 37 Versions
  • 8 % Grown

The README.md

Imperavi Redactor Widget for Yii 2

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads, (*1)

Imperavi Redactor Widget is a wrapper for Imperavi Redactor 10.2.5, a high quality WYSIWYG editor., (*2)

Note that Imperavi Redactor itself is a proprietary commercial copyrighted software but since Yii community bought OEM license you can use it for free with Yii., (*3)

Install

The preferred way to install this extension is through composer., (*4)

Either run, (*5)

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

or add, (*6)

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

to the require section of your composer.json file., (*7)

Usage

Once the extension is installed, simply use it in your code:, (*8)

Like a widget

echo \vova07\imperavi\Widget::widget([
    'name' => 'redactor',
    'settings' => [
        'lang' => 'ru',
        'minHeight' => 200,
        'plugins' => [
            'clips',
            'fullscreen',
        ],
        'clips' => [
            ['Lorem ipsum...', 'Lorem...'],
            ['red', '<span class="label-red">red</span>'],
            ['green', '<span class="label-green">green</span>'],
            ['blue', '<span class="label-blue">blue</span>'],
        ],
    ],
]);

Like an ActiveForm widget

use vova07\imperavi\Widget;

echo $form->field($model, 'content')->widget(Widget::className(), [
    'settings' => [
        'lang' => 'ru',
        'minHeight' => 200,
        'plugins' => [
            'clips',
            'fullscreen',
        ],
        'clips' => [
            ['Lorem ipsum...', 'Lorem...'],
            ['red', '<span class="label-red">red</span>'],
            ['green', '<span class="label-green">green</span>'],
            ['blue', '<span class="label-blue">blue</span>'],
        ],
    ],
]);

Like a widget for a predefined textarea

echo \vova07\imperavi\Widget::widget([
    'selector' => '#my-textarea-id',
    'settings' => [
        'lang' => 'ru',
        'minHeight' => 200,
        'plugins' => [
            'clips',
            'fullscreen',
        ],
        'clips' => [
            ['Lorem ipsum...', 'Lorem...'],
            ['red', '<span class="label-red">red</span>'],
            ['green', '<span class="label-green">green</span>'],
            ['blue', '<span class="label-blue">blue</span>'],
        ],
    ],
]);

Add images that have already been uploaded

// DefaultController.php
public function actions()
{
    return [
        'images-get' => [
            'class' => 'vova07\imperavi\actions\GetImagesAction',
            'url' => 'http://my-site.com/images/', // Directory URL address, where files are stored.
            'path' => '@alias/to/my/path', // Or absolute path to directory where files are stored.
            'options' => ['only' => ['*.jpg', '*.jpeg', '*.png', '*.gif', '*.ico']], // These options are by default.
        ],
    ];
}

// View.php
echo \vova07\imperavi\Widget::widget([
    'selector' => '#my-textarea-id',
    'settings' => [
        'lang' => 'ru',
        'minHeight' => 200,
        'imageUpload' => Url::to(['default/image-upload']),
        'imageManagerJson' => Url::to(['/default/images-get']),
        'plugins' => [
            'imagemanager',
        ],
    ],
]);

Add files that have already been uploaded

// DefaultController.php
public function actions()
{
    return [
        'files-get' => [
            'class' => 'vova07\imperavi\actions\GetFilesAction',
            'url' => 'http://my-site.com/files/', // Directory URL address, where files are stored.
            'path' => '@alias/to/my/path', // Or absolute path to directory where files are stored.
            'options' => ['only' => ['*.txt', '*.md']], // These options are by default.
        ],
    ];
}

// View.php
echo \vova07\imperavi\Widget::widget([
    'selector' => '#my-textarea-id',
    'settings' => [
        'lang' => 'ru',
        'minHeight' => 200,
        'fileUpload' => Url::to(['default/file-upload']),
        'fileManagerJson' => Url::to(['/default/files-get']),
        'plugins' => [
            'filemanager',
        ],
    ],
]);

Upload image

// DefaultController.php
public function actions()
{
    return [
        'image-upload' => [
            'class' => 'vova07\imperavi\actions\UploadFileAction',
            'url' => 'http://my-site.com/images/', // Directory URL address, where files are stored.
            'path' => '@alias/to/my/path', // Or absolute path to directory where files are stored.
        ],
    ];
}

// View.php
echo \vova07\imperavi\Widget::widget([
    'selector' => '#my-textarea-id',
    'settings' => [
        'lang' => 'ru',
        'minHeight' => 200,
        'imageUpload' => Url::to(['/default/image-upload']),
        'plugins' => [
            'imagemanager',
        ],
    ],
]);

Upload file

// DefaultController.php
public function actions()
{
    return [
        'file-upload' => [
            'class' => 'vova07\imperavi\actions\UploadFileAction',
            'url' => 'http://my-site.com/files/', // Directory URL address, where files are stored.
            'path' => '@alias/to/my/path', // Or absolute path to directory where files are stored.
            'uploadOnlyImage' => false, // For any kind of files uploading.
        ],
    ];
}

// View.php
echo \vova07\imperavi\Widget::widget([
    'selector' => '#my-textarea-id',
    'settings' => [
        'lang' => 'ru',
        'minHeight' => 200,
        'fileUpload' => Url::to(['/default/file-upload']),
        'plugins' => [
            'filemanager',
        ],
    ],
]);

Upload and replace a file with the same name

// DefaultController.php
public function actions()
{
    return [
        'file-upload' => [
            'class' => 'vova07\imperavi\actions\UploadFileAction',
            'url' => 'http://my-site.com/files/', // Directory URL address, where files are stored.
            'path' => '@alias/to/my/path', // Or absolute path to directory where files are stored.
            'uploadOnlyImage' => false, // For any kind of files uploading.
            'unique' => false,
            'replace' => true, // By default it throw an excepiton instead.
        ],
    ];
}

// View.php
echo \vova07\imperavi\Widget::widget([
    'selector' => '#my-textarea-id',
    'settings' => [
        'lang' => 'ru',
        'minHeight' => 200,
        'fileUpload' => Url::to(['/default/file-upload']),
        'plugins' => [
            'filemanager',
        ],
    ],
]);

Upload file and translit its name

// DefaultController.php
public function actions()
{
    return [
        'file-upload' => [
            'class' => 'vova07\imperavi\actions\UploadFileAction',
            'url' => 'http://my-site.com/files/', // Directory URL address, where files are stored.
            'path' => '@alias/to/my/path', // Or absolute path to directory where files are stored.
            'uploadOnlyImage' => false, // For any kind of files uploading.
            'unique' => false,
            'translit' => true,
        ],
    ];
}

// View.php
echo \vova07\imperavi\Widget::widget([
    'selector' => '#my-textarea-id',
    'settings' => [
        'lang' => 'ru',
        'minHeight' => 200,
        'fileUpload' => Url::to(['/default/file-upload']),
        'plugins' => [
            'filemanager',
        ],
    ]
]);

Add custom plugins

echo \vova07\imperavi\Widget::widget([
    'selector' => '#my-textarea-id',
    'settings' => [
        'lang' => 'ru',
        'minHeight' => 200,
        'plugins' => [
            'clips',
            'fullscreen'
        ]
    ],
    'plugins' => [
        'my-custom-plugin' => 'app\assets\MyPluginBundle',
    ],
]);

Enable custom image manager with delete functionality

// DefaultController.php
public function actions()
{
    return [
        'images-get' => [
            'class' => 'vova07\imperavi\actions\GetImagesAction',
            'url' => 'http://my-site.com/images/', // Directory URL address, where files are stored.
            'path' => '@alias/to/my/path', // Or absolute path to directory where files are stored.
        ],
        'image-upload' => [
            'class' => 'vova07\imperavi\actions\UploadFileAction',
            'url' => 'http://my-site.com/images/', // Directory URL address, where files are stored.
            'path' => '@alias/to/my/path', // Or absolute path to directory where files are stored.
        ],
        'file-delete' => [
            'class' => 'vova07\imperavi\actions\DeleteFileAction',
            'url' => 'http://my-site.com/statics/', // Directory URL address, where files are stored.
            'path' => '/var/www/my-site.com/web/statics', // Or absolute path to directory where files are stored.
        ],
    ];
}

// View.php
echo \vova07\imperavi\Widget::widget([
    'selector' => '#my-textarea-id',
    'settings' => [
        'lang' => 'ru',
        'minHeight' => 200,
        'imageUpload' => Url::to(['/default/image-upload']),
        'imageDelete' => Url::to(['/default/file-delete']),
        'imageManagerJson' => Url::to(['/default/images-get']),
    ],
    'plugins' => [
        'imagemanager' => 'vova07\imperavi\bundles\ImageManagerAsset',              
    ],
]);

Enable custom file manager with delete functionality

// DefaultController.php
public function actions()
{
    return [
        'files-get' => [
            'class' => 'vova07\imperavi\actions\GetFilesAction',
            'url' => 'http://my-site.com/images/', // Directory URL address, where files are stored.
            'path' => '@alias/to/my/path', // Or absolute path to directory where files are stored.
        ],
        'file-upload' => [
            'class' => 'vova07\imperavi\actions\UploadFileAction',
            'url' => 'http://my-site.com/files/', // Directory URL address, where files are stored.
            'path' => '@alias/to/my/path', // Or absolute path to directory where files are stored.
            'uploadOnlyImage' => false, // For any kind of files uploading.
        ],
        'file-delete' => [
            'class' => 'vova07\imperavi\actions\DeleteFileAction',
            'url' => 'http://my-site.com/statics/', // Directory URL address, where files are stored.
            'path' => '/var/www/my-site.com/web/statics', // Or absolute path to directory where files are stored.
        ],
    ];
}

// View.php
echo \vova07\imperavi\Widget::widget([
    'selector' => '#my-textarea-id',
    'settings' => [
        'lang' => 'ru',
        'minHeight' => 200,
        'fileUpload' => Url::to(['/default/file-upload']),
        'fileDelete' => Url::to(['/default/file-delete']),
        'fileManagerJson' => Url::to(['/default/files-get']),
    ],
    'plugins' => [
        'filemanager' => 'vova07\imperavi\bundles\FileManagerAsset',              
    ],
]);

Testing

bash $ phpunit, (*9)

Further Information

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

Contributing

Please see CONTRIBUTING for details., (*11)

Credits

License

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

Upgrade guide

Please check the UPGRADE GUIDE for details., (*13)

The Versions

22/06 2018

dev-master

9999999-dev https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

22/06 2018

2.0.5

2.0.5.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

21/06 2018

2.0.4

2.0.4.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

19/03 2018

2.0.3

2.0.3.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

19/03 2018

2.0.2.x-dev

2.0.2.9999999-dev https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

28/01 2018

2.0.2

2.0.2.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

09/12 2017

2.0.1

2.0.1.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

04/12 2017

2.0.0

2.0.0.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

02/12 2017

1.3.2

1.3.2.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

07/08 2017

1.3.1

1.3.1.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

19/07 2017

1.3.0

1.3.0.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

10/12 2015

1.2.10

1.2.10.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

21/08 2015

1.2.9

1.2.9.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

30/07 2015

1.2.8

1.2.8.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

29/06 2015

1.2.7

1.2.7.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

11/06 2015

1.2.6

1.2.6.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

29/05 2015

1.2.5

1.2.5.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

29/05 2015

1.2.4

1.2.4.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

13/05 2015

1.2.3

1.2.3.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

03/04 2015

1.2.2

1.2.2.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

30/03 2015

1.2.1

1.2.1.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

08/03 2015

1.2.0

1.2.0.0 https://github.com/vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

extension yii2 yii yii 2 widget wysiwyg imperavi redactor

02/03 2015

1.1.12

1.1.12.0

The imperavi redactor widget for Yii framework.

  Sources   Download

proprietary

The Requires

 

by Veaceslav Medvedev

yii2 yii 2 widget wysiwyg imperavi redactor

01/03 2015

1.1.11

1.1.11.0

The imperavi redactor widget for Yii framework.

  Sources   Download

proprietary

The Requires

 

by Veaceslav Medvedev

yii2 yii 2 widget wysiwyg imperavi redactor

01/03 2015

1.1.10

1.1.10.0

The imperavi redactor widget for Yii framework.

  Sources   Download

proprietary

The Requires

 

by Veaceslav Medvedev

yii2 yii 2 widget wysiwyg imperavi redactor

01/03 2015

1.1.9

1.1.9.0

The imperavi redactor widget for Yii framework.

  Sources   Download

proprietary

The Requires

 

by Veaceslav Medvedev

yii2 yii 2 widget wysiwyg imperavi redactor

25/01 2015

1.1.8

1.1.8.0

The imperavi redactor widget for Yii framework.

  Sources   Download

proprietary

The Requires

 

by Veaceslav Medvedev

yii2 yii 2 widget wysiwyg imperavi redactor

25/01 2015

1.1.7

1.1.7.0

The imperavi redactor widget for Yii framework.

  Sources   Download

proprietary

The Requires

 

by Veaceslav Medvedev

yii2 yii 2 widget wysiwyg imperavi redactor

15/12 2014

1.1.6

1.1.6.0

The imperavi redactor widget for Yii framework.

  Sources   Download

proprietary

The Requires

 

by Veaceslav Medvedev

yii2 yii 2 widget wysiwyg imperavi redactor

02/12 2014

1.1.5

1.1.5.0

The imperavi redactor widget for Yii framework.

  Sources   Download

proprietary

The Requires

 

by Veaceslav Medvedev

yii2 yii 2 widget wysiwyg imperavi redactor

17/11 2014

1.1.4

1.1.4.0

The imperavi redactor widget for Yii framework.

  Sources   Download

proprietary

The Requires

 

by Veaceslav Medvedev

yii2 yii 2 widget wysiwyg imperavi redactor

06/11 2014

1.1.3

1.1.3.0

The imperavi redactor widget for Yii framework.

  Sources   Download

proprietary

The Requires

 

by Veaceslav Medvedev

yii2 yii 2 widget wysiwyg imperavi redactor

24/10 2014

1.1.2

1.1.2.0

The imperavi redactor widget for Yii framework.

  Sources   Download

proprietary

The Requires

 

by Veaceslav Medvedev

yii2 yii 2 widget wysiwyg imperavi redactor

13/10 2014

1.1.1

1.1.1.0

The imperavi redactor widget for Yii framework.

  Sources   Download

proprietary

The Requires

 

by Veaceslav Medvedev

yii2 yii 2 widget wysiwyg imperavi redactor

29/09 2014

1.1.0

1.1.0.0

The imperavi redactor widget for Yii framework.

  Sources   Download

proprietary

The Requires

 

by Veaceslav Medvedev

yii2 yii 2 widget wysiwyg imperavi redactor

19/08 2014

1.0.1

1.0.1.0

The imperavi redactor widget for Yii framework.

  Sources   Download

proprietary

The Requires

 

by Veaceslav Medvedev

yii2 yii 2 widget wysiwyg imperavi redactor

05/07 2014

1.0.0

1.0.0.0

The imperavi redactor widget for Yii framework.

  Sources   Download

proprietary

The Requires

 

by Veaceslav Medvedev

yii2 yii 2 widget wysiwyg imperavi redactor