Redactor class not found

Hi there,

I’ve followed directions on redactor’s github page and confirmed that yii2-redactor exists in the 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


<?= $form->field($item, ‘times’)->widget(Redactor::className()); ?>

but I just keep getting

Class ‘yii\redactor\widgets\Redactor’ not found

I’m sure I’m missing something really simple but can’t for the life of me figure out what else I need to change.

Thanks for your help

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.

1 Like