yiidoc / yii2-redactor

Extension Redactor WYSIWYG for Yii2 framework
BSD 3-Clause "New" or "Revised" License
187 stars 87 forks source link

yii\redactor\widgets\Redactor not found #39

Open rawevolution opened 8 years ago

rawevolution commented 8 years ago

Have followed directions and confirmed that yii2-redactor exists in vendor/yiidoc folder, web.php has been updated and I've tried using <?= $form->field($item, 'times')->widget(\yii\redactor\widgets\Redactor::className()) ?> as well as doing: use yii\redactor\widgets\Redactor with
<?= $form->field($item, 'times')->widget(Redactor::className()) ?> as well as changing to use yii\redactor\Redactor as per the namespace but no matter what I do I always get a class not found error.

Cheers

rawevolution commented 8 years ago

No one else seemed to have this issue but if they do, the issue for me was that even though I installed redactor with composer for some reason the extensions.php file in the vendors folder had '@yii/redactor' => '/', and it needed to be changed to: '@yii/redactor' => $vendorDir . '/yiidoc/yii2-redactor', for it to be found.

mattdalmau commented 8 years ago

I had the same issue on Windows and your solution works but for some reason, it works on linux without updating extensions.php

JSkrat commented 7 years ago

probably i'm doing something wrong, but for my advanced yii2 template neither of tinymce, ckeditor or this widget work. It looks like yii doesn't see all of them at all despite they're installed through composer and do exists in vendor directory. I put in their main files typo for a purpose, but totally nothing changed, it throws "Class 'yii\redactor\widgets\Redactor' not found" error when i try to "echo $form->field($model, $f->name)->widget(\yii\redactor\widgets\Redactor::className());". That's happening on linux machine, btw

Yes, i did try to update extensions.php, but that didn't help neither

JSkrat commented 7 years ago

well, okay. I had used a wrong composer.json file. projectroot/composer.json instead of projectroot/advanced/composer.json Now it works.