i’m trying to build a form with Kartik Form Builder, but i’mstucked with the datecontrol and datepicker. Apparently I cannot save the date in the correct mysql format; it’s saved as 0000-00-00.
Following the instructions I get a php error [i]PHP Fatal error: Class ‘kartik\\datecontrol\\Module’ not found in /var/www/html/alex/config/params.php on line 9
[/i]
This is my params.php file
<?php
use kartik\datecontrol\Module;
return [
'adminEmail' => 'admin@example.com',
// format settings for displaying each date attribute (ICU format example)
'dateControlDisplay' => [
Module::FORMAT_DATE => 'dd-MM-yyyy',
Module::FORMAT_TIME => 'HH:mm:ss a',
Module::FORMAT_DATETIME => 'dd-MM-yyyy HH:mm:ss a',
],
// format settings for saving each date attribute (PHP format example)
'dateControlSave' => [
Module::FORMAT_DATE => 'php:U', // saves as unix timestamp
Module::FORMAT_TIME => 'php:H:i:s',
Module::FORMAT_DATETIME => 'php:Y-m-d H:i:s',
]
];
on params.php
Generally I cannot fully understand where to put the code in yii… Maybe someone could give me a hint?