通过composer安装 dosamigos DatePicker
"2amigos/yii2-date-picker-widget" : "*"
php页面引用
<?php use dosamigos\datepicker\DatePicker;?>
<?
$form->field($model, 'date')->widget(
DatePicker::className(), [
// inline too, not bad
'inline' => true,
// modify template for custom rendering
'template' => '<div class="well well-sm" style="background-color: #fff; width:250px">{input}</div>',
'clientOptions' => [
'autoclose' => true,
'format' => 'dd-M-yyyy'
]
]);
?>
没报错,但是就是显示不了