0

I'm using datepicker (kartik) on my yii2 project. And it's working fine locally. But when I push this project to remote server via git it's indicating error like this: enter image description here

Please share me if anybody knows what is going on here. I've encountered strange thing. This is my git server: enter image description here

And there is no this folder in my remote server. yii2-widget-datepicker folder should be included because Datepicker class is inside this folder. So, what should I do in this case?? What solution would be best??

When I try to add yii2-widget-datepicker in my local project an error comes: enter image description here

Scott
  • 4,974
  • 6
  • 35
  • 62
  • I just found the solution: http://stackoverflow.com/questions/23612012/fatal-pathspec-autoload-classmap-php-is-in-submodule-module-cocktailmakermod – Scott May 16 '17 at 13:51

2 Answers2

0

you need to update the composer on your remote server.

php composer.phar update

If you have committed the composer.json file then the datepicker widget will get included on your remote server

Shrikant
  • 384
  • 2
  • 10
  • When I try to update remote composer as you say I've encountered an error: `PHP Parse error: syntax error, unexpected '[' in mysite/httpdocs/vendor/yiisoft/yii2-composer/Plugin.php on line 31` – Scott May 16 '17 at 13:23
0

It seems you forgot to import the class. Try

use kartik\date\DatePicker;

Official Documentation

Chux
  • 1,196
  • 1
  • 9
  • 24
  • No I didn't. I added class. But there was no Datepicker.php file which involves Datepicker class. When I pushed local project to remote server via git, one folder wasn't pushed. So I cleared a folder (which keeps Datepicker.php) from git and added one more time. This is the solution ))) – Scott May 17 '17 at 04:39