2017 © Pedro Peláez
 

yii2-extension yii2-summernote

Yii2 Summernote widget. Super simple WYSIWYG editor on Bootstrap

image

marqu3s/yii2-summernote

Yii2 Summernote widget. Super simple WYSIWYG editor on Bootstrap

  • Friday, January 15, 2016
  • by marqu3s
  • Repository
  • 3 Watchers
  • 10 Stars
  • 15,685 Installations
  • PHP
  • 9 Dependents
  • 0 Suggesters
  • 21 Forks
  • 0 Open issues
  • 6 Versions
  • 17 % Grown

The README.md

Yii2 Summernote widget. Summernote 0.9.1

Yii2 Summernote widget. Super simple WYSIWYG editor on Bootstrap, (*1)

Installation

Composer

The preferred way to install this extension is through Composer., (*2)

Either run, (*3)

composer require marqu3s/yii2-summernote

or add, (*4)

"marqu3s/yii2-summernote": "dev-master"

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

Usage

<?= $form->field($model, 'content')->widget(Summernote::className(), [
    'clientOptions' => [
        ...
    ]
]); ?>

or, (*6)

<?= Summernote::widget([
    'name' => 'editor_id',
    'clientOptions' => [
        ...
    ]
]); ?>

Uploading directly to Amazon S3

To upload images inserted into the editor to S3, you have to configure a few options., (*7)

<?= Summernote::widget([
    'uploadToS3' => true,
    'signEndpoint' => '/<controller>/sign-aws-request?v4=true',
    'bucket' => 'S3-BUCKET-NAME',
    //'folder' => '',
    'folder' => new \yii\web\JsExpression("function() { return $('#aFormFieldId').val() + '/'; }"),
    'filenamePrefix' => "'{$model->id}-'",
    'maxFileSize' => 1024000,
    'expiration' => gmdate('Y-m-d\TH:i:s.000\Z', strtotime('+5 minutes')),
    'clientOptions' => [
        ...
    ]
]); ?>

Then, in your controller, configure an action as the signEndpoint to sign the POST request that will upload the image., (*8)

public function actions()
{
   return [
      'sign-aws-request' => [
          'class' => 'common\actions\SignAwsRequestAction',
          'clientPrivateKey' => 'AWS-KEY',
          'clientPrivateSecret' => 'AWS-SECRET',
          'expectedBucketName' => 'BUCKET-NAME',
          'expectedHostName' => 'BUCKET-NAME',
          'expectedMaxSize' => 'MAX-FILE-SIZE'
      ]
   ];
}

See clientOptions, (*9)

Original Author

Aleksandr Zelenin, e-mail: aleksandr@zelenin.me, (*10)

Updates by

João Marques, e-mail: joao@jjmf.com, (*11)

The Versions

15/01 2016

dev-master

9999999-dev https://github.com/marqu3s/yii2-summernote

Yii2 Summernote widget. Super simple WYSIWYG editor on Bootstrap

  Sources   Download

MIT

The Requires

 

by Joao Marques

yii2 widget wysiwyg summernote

15/01 2016

v1.0.0

1.0.0.0 https://github.com/marqu3s/yii2-summernote

Yii2 Summernote widget. Super simple WYSIWYG editor on Bootstrap

  Sources   Download

MIT

The Requires

 

by Joao Marques

yii2 widget wysiwyg summernote

02/11 2014

0.0.4

0.0.4.0 https://github.com/zelenin/yii2-summernote-widget

Yii2 Summernote widget. Super simple WYSIWYG editor on Bootstrap

  Sources   Download

MIT

The Requires

  • yiisoft/yii2 ~2
  • bower-asset/fontawesome ~4@stable
  • bower-asset/codemirror ~4@stable
  • bower-asset/summernote ~0.5@stable

 

yii2 widget wysiwyg summernote

02/11 2014

0.0.5

0.0.5.0 https://github.com/zelenin/yii2-summernote-widget

Yii2 Summernote widget. Super simple WYSIWYG editor on Bootstrap

  Sources   Download

MIT

The Requires

  • yiisoft/yii2 ~2
  • bower-asset/fontawesome ~4@stable
  • bower-asset/codemirror @stable
  • bower-asset/summernote ~0.5@stable

 

yii2 widget wysiwyg summernote

27/10 2014

0.0.3

0.0.3.0 https://github.com/zelenin/yii2-summernote-widget

Yii2 Summernote widget. Super simple WYSIWYG editor on Bootstrap

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • yiisoft/yii2 *
  • bower-asset/fontawesome @stable
  • bower-asset/codemirror @stable
  • bower-asset/summernote @stable

 

yii2 widget wysiwyg summernote

25/03 2014

0.0.1

0.0.1.0 https://github.com/zelenin/yii2-summernote-widget

Yii2 Summernote widget. Super simple WYSIWYG editor on Bootstrap

  Sources   Download

MIT

The Requires

 

yii2 widget wysiwyg summernote