PHP code example of m-comscience / yii2-datepicker-thai

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

    

m-comscience / yii2-datepicker-thai example snippets


use mcomscience\datepicker\DatePicker;

// usage without model
echo \yii\helpers\Html::label('Date');
echo DatePicker::widget([
	'name' => 'date', 
	'value' => date('d/m/Y'), // 10/10/2561
	'options' => ['placeholder' => 'Select date ...'],
	'pluginOptions' => [
            'autoclose' => true,
            'format' => 'dd/mm/yyyy',
            'language' => 'th',
            'todayHighlight' => true,
            'todayBtn' => true,
        ],
]);