PHP code example of asofter / yii2-imperavi-redactor

1. Go to this page and download the library: Download asofter/yii2-imperavi-redactor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

asofter / yii2-imperavi-redactor example snippets


yii\imperavi\Widget::widget([
	// You can either use it for model attribute
	'model' => $my_model,
	'attribute' => 'my_field',

	// or just for input field
	'attribute' => 'my_input_name',

	// Some options, see http://imperavi.com/redactor/docs/
	'options' => [
		'toolbar' => false,
		'css' => 'wym.css',
	],
]);

use yii\imperavi\Widget;
use yii\widgets\ActiveForm;

$form = ActiveForm::begin();

echo $form->field($model, 'my_field')->widget(Widget::classname(), 'options' => []);

yii\imperavi\Widget::widget([
	// Some options, see http://imperavi.com/redactor/docs/
	'options' => [],
]);

yii\imperavi\Widget::widget([
	'options' => [
		'lang' => 'ru',
	],
	'plugins' => [
		'fullscreen',
		'clips'
	]
]);

php composer.phar