Yii Framework Forum: Yii2 Class 'SummerNote' Not Found - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii2 Class 'SummerNote' Not Found SummerNote class not found Rate Topic: -----

#1 User is offline   FarHunt95 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 13-July 16

Posted 13 July 2016 - 11:05 PM

Hi, I am creating a Faq modules and I want to insert SummerNote package so that the form can look nicer

But error 'SummerNote' class not found came out

Below i have attatched my summernote directory package folder structure

I have check my composer.json and

"marqu3s/yii2-summernote": "dev-master" is already in there

I also check in vendor/yiisoft/extensions and

'marqu3s/yii2-summernote' =>
array (
'name' => 'marqu3s/yii2-summernote',
'version' => '9999999-dev',
'alias' =>
array (
'@marqu3s/summernote' => $vendorDir . '/marqu3s/yii2-summernote',
),
),

is already in there

below I attached my Faq controller and view page and the error that came out, I have tried many solution but nothing comes out, error Summernote class not found .

Attached File(s)


0

#2 User is offline   Bizley 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 922
  • Joined: 29-July 14
  • Location:Wrocław

Posted 14 July 2016 - 12:49 AM

The proper namespace is marqu3s\summernote\Summernote
What editor are you using, is it Sublime? Maybe there is a way there to get namespaces hints like in any proper IDE.
http://bizley.pl ʕ•ᴥ•ʔ
0

#3 User is offline   FarHunt95 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 13-July 16

Posted 14 July 2016 - 01:17 AM

Yes, I am using Sublime Text 3

I remove the below code from DefaultController and transfer it into form.php

"
use marqu3s\summernote\Summernote;
use marqu3s\summernote\SummernoteAsset;
use marqu3s\summernote\SummernoteLanguageAsset;
"

but other error come out, it says

Getting unknown property: backend\modules\faq\model\Faq::content

Any idea?, I think it is because of this line of code

"

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


"
0

#4 User is offline   Bizley 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 922
  • Joined: 29-July 14
  • Location:Wrocław

Posted 14 July 2016 - 02:03 AM

SummernoteAsset and SummernoteLanguageAsset are asset classes that are registered by this widget so you don't have to add use with them. As for the error you get it's probably because you are using this widget on attribute 'content' that is not present in Faq model. Looks like you need some reading first, here are my recommendations:


http://bizley.pl ʕ•ᴥ•ʔ
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users