Reputation: 1141
I downloaded the yii2-jui in this link
After that I put it under yiisoft folder
yiisoft\yii2-jui
when I run my application it gives me this error
PHP Fatal Error – yii\base\ErrorException Class 'yii\jui\DatePicker' not found
How can I fixed this.where should I put the yii2-jui folder ?
Thank you in advance
Upvotes: 3
Views: 13247
Reputation: 397
I fixed the problem when I ran
sudo composer require --prefer-dist yiisoft/yii2-jui
"*"
ONLY IN FOLDER basic
, where are web
, yii
, models
and etc.
Upvotes: 7
Reputation: 4630
insert code:
'yiisoft/yii2-jui' =>
array (
'name' => 'yiisoft/yii2-jui',
'version' => '2.0.2',
'alias' =>
array (
'@yii/jui' => $vendorDir . '/yiisoft/yii2-jui',
),
),
in yiisoft/extensions.php file
Upvotes: 2
Reputation: 780
Insert this in the view:
use yii\jui\DatePicker;
The best way is: run: php composer.phar require --prefer-dist yiisoft/yii2-jui "*" in your project
Upvotes: 2
Reputation: 9357
Stop creating duplicate questions.
And you do not just download something and copy it in a folder. Use composer to install it. the Yii2 that you copied is just a shell, you have to use composer to install the rest of it. Composer does more then just copy the files it creates an autoloader that tells yii where everything is.
Upvotes: -2