phpyii2yii-extensionsyii2-basic-appyii-modules

Yii2. Kartik datecontrol. Not initializes the datecontrol module


I tried to use yii2-datecontrol module, but it not initializes. How to fix it?

Here is my web.php

'modules'    => [
        ...
        'datecontrol' => [
            'class'          => 'kartik\datecontrol\Module',
            'widgetSettings' => [

                'displaySettings' => [
                    kartik\datecontrol\Module::FORMAT_DATE     => 'dd-MM-yyyy',
                    kartik\datecontrol\Module::FORMAT_TIME     => 'hh:mm:ss a',
                    kartik\datecontrol\Module::FORMAT_DATETIME => 'dd-MM-yyyy hh:mm:ss a',
                ],

                // format settings for saving each date attribute (PHP format example)
                'saveSettings'    => [
                    kartik\datecontrol\Module::FORMAT_DATE     => 'php:U', // saves as unix timestamp
                    kartik\datecontrol\Module::FORMAT_TIME     => 'php:H:i:s',
                    kartik\datecontrol\Module::FORMAT_DATETIME => 'php:Y-m-d H:i:s',
                ],

            ]
        ], 
        ...
    ],

Here is my modules, as you can see, the rest is objects, but datecontrol is an array.

enter image description here


Solution

  • It initializes, when it's being called at least once.