it finished successfully downloading the extension.
but after that i got two composer.json files one inside my project and the other at home directory
the one at home directoy includes only:
{
"require": {
"yiisoft/yii2-jui": "*"
}
}
and the other one in project includes everyting except “yiisoft/yii-jui”: “*”, after that i proceeded to try DatePicker widget in my project and it says “Class ‘yii\jui\DatePicker’ not found” with note that i used at the top of my page:
namespace yii\jui\DatePicker;
use yii\jui\DatePicker;
Hopefully anyone can enlighten me with the solution i will appreciate it, thanks.
The use statement should be used on the view in which you are using the widget, not the namespace, so if you are using both, it will not work. So just to be clear, the top of your view file should have:
use yii\jui\DatePicker;
The namespace on the DatePicker.php file should be:
namespace yii\jui;
This would have been set when you installed the extension, so you should not have to add it. The two should not appear in the same file together.
Thank you Mr. Evercode, i fixed the problem, it was because i made the manual download for the extension without using the composer, then i used the composer to download it and everything working smoothly. Thank you so much, God bless you .