kartik-v / yii2-editors

Yii2 editor widgets Summernote and Codemirror.
Other
22 stars 7 forks source link

Cannot use [] for reading in #8

Closed tholag closed 3 years ago

tholag commented 3 years ago

Prerequisites

Steps to reproduce the issue

  1. use PHP Version 5.6.40 on CentOS
  2. use Demo of Summernote with model and activeform:

// Usage with ActiveForm and model and default settings echo $form->field($model, 'content')->widget(Summernote::class, [ 'options' => ['placeholder' => 'Edit your blog content here...'] ]);

Expected behavior and actual behavior

PHP Compile Error: yii\base\ErrorException - Cannot use [] for reading in /var/www/inwanet.inwatec.com/public_html/vendor/kartik-v/yii2-editors/src/assets/BaseAsset.php

Fix: change Line 27 in the above file from: $this->$ext[] = YII_DEBUG ? "{$file}.{$ext}" : "{$file}.min.{$ext}";

to: $this->{$ext}[] = YII_DEBUG ? "{$file}.{$ext}" : "{$file}.min.{$ext}";

Environment

Browsers

Operating System

Libraries

Isolating the problem