2amigos / yii2-ckeditor-widget

CKEditor WYSIWYG widget for Yii2.
https://2amigos.us/open-source/ckeditor-widget
Other
172 stars 112 forks source link

syntax error, unexpected '.', expecting ',' or ';' #88

Closed sauravsuman1 closed 7 years ago

sauravsuman1 commented 7 years ago

Version :: ^2.0 vendor/2amigos/yii2-ckeditor-widget/src/CKEditorWidgetAsset.php :: line 21

Got this error on first time use.

Resolve this by changing the original code

ORIGINAL CODE

`class CKEditorWidgetAsset extends AssetBundle { public $sourcePath = DIR . '/assets';

public $depends = [
    'dosamigos\ckeditor\CKEditorAsset'
];

public $js = [
    'dosamigos-ckeditor.widget.js'
];

}`

NEW CODE

class CKEditorWidgetAsset extends AssetBundle { public $sourcePath;

public $depends = [
    'dosamigos\ckeditor\CKEditorAsset'
];

public $js = [
    'dosamigos-ckeditor.widget.js'
];

public function init(){
    $this->sourcePath = __DIR__ . '/assets';
}

}

maan81 commented 7 years ago

Same error.

ipppinto commented 7 years ago

Me too.

The code have to change to:

class CKEditorWidgetAsset extends AssetBundle { public $sourcePath;

public $depends = [ 'dosamigos\ckeditor\CKEditorAsset' ];

public $js = [ 'dosamigos-ckeditor.widget.js' ];

public function init(){ $this->sourcePath = DIR . '/assets'; } }

nicosavini commented 7 years ago

Me too. Only in production server. Probably something to do with PHP config, but I believe it's better if it's fixed from source as it can be easily solved.

tonydspaniard commented 7 years ago

@nicosavini do you mind checking master? A contribution may have fixed the issue.

nicosavini commented 7 years ago

Seems to be working now.

tonydspaniard commented 7 years ago

Good! I will update the version then...