PHP code example of kovalenkojuls / yii2-widget-combodate

1. Go to this page and download the library: Download kovalenkojuls/yii2-widget-combodate library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kovalenkojuls / yii2-widget-combodate example snippets


use kovalenkojuls\date\CombodateWidget;

// usage without model
echo '<label>Check Date</label>';
echo CombodateWidget::widget([
	'name' => 'check_date', 
	'options' => [
               'language'       => 'ru',
               'data-format'    => 'DD.MM.YYYY',
               'data-template'  => 'D MMMM YYYY',
               'customClass'    => 'form-control'
           ]
]);

//.......................................................................

// usage model
$form = ActiveForm::begin();
echo $form->field($model, 'birthday')->widget(CombodateWidget::className(),
       [
           'value'   => $model->birthday ? $model->birthday : '',
           'options' => [
               'language'       => 'ru',
               'data-format'    => 'DD.MM.YYYY',
               'data-template'  => 'D MMMM YYYY',
               'customClass'    => 'form-control'
           ]
       ])

$ php composer.phar