PHP code example of pcrt / yii2-datepicker

1. Go to this page and download the library: Download pcrt/yii2-datepicker 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/ */

    

pcrt / yii2-datepicker example snippets


use pcrt\widgets\datepicker\Datepicker:


// with \yii\bootstrap\ActiveForm;
echo $form
    ->field($model, 'attribute')
    ->widget(
        Datepicker::class,
        [
          'clientOptions' => [
            'singleDatePicker' => true,
            'showDropdowns' => true,
          ]
        ]
    );

// as widget
echo Datepicker::widget([
    'clientOptions' => [
      'showDropdowns' => true,
    ]
]);

$ php composer.phar