I've used mootensai/yii2-enhanced-gii and they said I should add this code at config\main.php
:
'modules' => [
'gridview' => [
'class' => '\kartik\grid\Module',
// see settings on http://demos.krajee.com/grid#module
],
'datecontrol' => [
'class' => '\kartik\datecontrol\Module',
// see settings on http://demos.krajee.com/datecontrol#module
],
// If you use tree table
'treemanager' => [
'class' => '\kartik\tree\Module',
// see settings on http://demos.krajee.com/tree-manager#module
]
],
I am using Yii2 Basic so I add it to config/web.php
like below
'components' => [
// some code here !
],
'modules' => [
'gridview' => [
'class' => '\kartik\grid\Module',
],
'datecontrol' => [
'class' => '\kartik\datecontrol\Module',
],
'treemanager' => [
'class' => '\kartik\tree\Module',
]
],
So when I run the generated code from Gii it gives me the code for date filed like this:
<?= $form->field($model, 'regester_end_date')->widget(\kartik\datecontrol\DateControl::classname(), [
'type' => \kartik\datecontrol\DateControl::FORMAT_DATE,
'saveFormat' => 'php:Y-m-d',
'ajaxConversion' => true,
'options' => [
'pluginOptions' => [
'placeholder' => Yii::t('app', 'Choose Regester End Date'),
'autoclose' => true
]
],
]); ?>
When I run my form, it gives me a problem that says Class 'kartik\datecontrol\DateControl' not found
. I updated the composer and I install the the kartik widgets and there is nothing happens