Datepicker用法

来源:互联网 发布:c语言volatile的用法 编辑:程序博客网 时间:2024/06/08 08:40
安装yii2-date-picker-widget插件
链接地址 https://github.com/2amigos/yii2-date-picker-widget
修改index.php文件
#code ...
use dosamigos \datepicker\ DatePicker;
#code ...
<?= $form ->field( $model, 'company_address' )->textInput (['maxlength' => true]) ?>

<?=
 $form ->field( $model, 'company_start_date' )->widget (
   
 DatePicker ::className(), [
       
 // inline too, not bad
       
 'inline' => false
       
 // modify template for custom rendering
        //'template' => '<div class="well well-sm" style="background-color: #fff; width:250px">{input}</div>',
       
 'clientOptions' => [
           
 'autoclose' => true,
           
 'format' => 'yyyy-m-d'
       
 ]
    ]);
?>

<?=
 $form ->field( $model, 'company_created_date' )->textInput () ?>
#code ...
0 0
原创粉丝点击