suzumiya
(Nekoanimetv)
1
Hi, I’m new using Yii 2 and the first time en install a widget.
I installed from here with composer and says that was installed
https: //github. com/kartik-v/yii2-widget-rating
on a .php file created in the folder view, I get this error
PHP Fatal Error – yii\base\ErrorException
Class 'kartik\widgets\StarRating' not found
softark
(Softark)
2
If you have installed "kartik-v/yii2-widget-rating", then the namespace should be "kartik\rating" instead of "kartik\widgets".
suzumiya
(Nekoanimetv)
3
thank
i have another error now:
Class 'StarRating' not found
code complete
<?php
use kartik\rating;
?>
<?php
echo StarRating::widget([
'name' => 'rating_1',
'pluginOptions' => ['disabled'=>true, 'showClear'=>false]
]);
softark
(Softark)
4
<?php
use kartik\rating\StarRating;
echo StarRating::widget([
'name' => 'rating_1',
'pluginOptions' => ['disabled'=>true, 'showClear'=>false]
]);