Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jui\datepicker class not found

Tags:

yii2

I would like to use datepicker in my form. So for that I have used the jui with below step:

  • Added this line

"yiisoft/yii2-jui": "~2.0.0"

in composer.json at root in my folder.

  • Added this line in my form file,

use yii\jui\DatePicker;

  • Added the tag in my form file,

<?= $form->field($model,'country_created_date')->widget(DatePicker::className(), ['clientOptions' => ['defaultDate' => '2014-01-01']]) ?>

And when I run the form I am getting this kind of error:

"Class 'yii\jui\DatePicker' not found"

I have also tried to update the composer using the composer update.

Any body can help me please.

like image 755
nim Avatar asked Mar 09 '26 12:03

nim


1 Answers

Make sure that fxp asset plugin is installed:

composer global require "fxp/composer-asset-plugin:~1.1.1"

After installing it try composer update.

like image 128
meysam Avatar answered Mar 12 '26 13:03

meysam