aekkapun/yii2-bootstrap4-date-thai-widget
Composer 安装命令:
composer require aekkapun/yii2-bootstrap4-date-thai-widget
包简介
Bootstrap4 DatePicker Thai Yii2.
README 文档
README
This is thai buddhist calendar datepicker of Yii2 extension.
modified from (https://github.com/2amigos/yii2-date-picker-widget).
Installation
The preferred way to install this extension is through composer.
Either run
$ composer require karatae99/yii2-date-picker-thai-widget "~1.0"
or add
"karatae99/yii2-date-picker-thai-widget" : "~1.0"
to the require section of your application's composer.json file.
Usage
DatePicker
This widget renders a Bootstrap DatePicker input control. Best suitable for model with date string attribute.
Example of use with a form
There are two ways of using it, with an ActiveForm instance or as a widget setting up its model and attribute.
<?php use karatae99\datepicker\DatePicker; // as a widget ?> <?= DatePicker::widget([ 'model' => $model, 'attribute' => 'date', 'template' => '{addon}{input}', 'language' => 'th', // Thai B.E. 'clientOptions' => [ 'autoclose' => true, 'format' => 'dd/mm/yyyy' ] ]);?> <?php // with an ActiveForm instance ?> <?= $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>', 'language' => 'th', // Thai B.E. 'clientOptions' => [ 'autoclose' => true, 'format' => 'dd/mm/yyyy' ] ]);?>
Example of use without a model
<?php use karatae99\datepicker\DatePicker; ?> <?= DatePicker::widget([ 'name' => 'Test', 'value' => '20/03/2561', 'template' => '{addon}{input}', 'language' => 'th', // Thai B.E. 'clientOptions' => [ 'autoclose' => true, 'format' => 'dd/mm/yyyy' ] ]);?>
Further Information
Please, check the Bootstrap DatePicker site documentation for further information about its configuration options.
License
The BSD License (BSD). Please see License File for more information.
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2021-01-04