Step 1: Install below extension from github
$ php composer.phar require kartik-v/yii2-widget-datepicker "@dev"
Step 2: Use below code in your view file
use kartik\date\DatePicker; // usage without model echo ''; echo DatePicker::widget([ 'name' => 'birth_date', 'value' => date('d-M-Y'), 'options' => ['placeholder' => 'Select birth date'], 'pluginOptions' => [ 'format' => 'dd-M-yyyy', ] ]);
No comments:
Post a Comment