Faryshta Yii2 ClockPicker
, (*1)
Bootstrap and Jquery Yii2 widgets for clockpicker
(clock-like time picker) jquery plugin, (*2)
Installation
The preferred way to install this extension is through composer., (*3)
Either run, (*4)
composer require --prefer-dist "faryshta/yii2-clockpicker:*"
or add, (*5)
"faryshta/yii2-clockpicker": "*"
to the require
section of your composer.json
file., (*6)
If you want to use the Bootstrap ClockPicker you need to include the
yiisoft/yii2-bootstrap
extension, (*7)
composer require --prefer-dist "yiisoft/yii2-bootstrap:*"
or add, (*8)
"yiisoft/yii2-bootstrap": "*"
Usage
Jquery
In the view file register the asset:, (*9)
use farystha\widgets\JqueryClockPicker;
// with ActiveForm
echo $form->field($model, 'attribute')->widget(JqueryClockPicker::className() [
// extra configuration
]);
// without ActiveForm and with model.
echo JqueryClockPicker::widget([
'model' => $person,
'attribute' => 'gender',
]);
Bootstrap
In the view file register the asset:, (*10)
use farystha\widgets\BootstrapClockPicker;
// with ActiveForm
echo $form->field($model, 'attribute')->widget(BootstrapClockPicker::className() [
// extra configuration
]);
// without ActiveForm and with model.
echo BootstrapClockPicker::widget([
'model' => $person,
'attribute' => 'gender',
]);
Documentation
This library doesn't define anything new, the widgets classes are very similar
to the class \yii\bootstrap\Widget which can be used as documentation for the widget classes., (*11)
The JS options can be passed using the $clientOptions
property and the events
can be declared using the $clientEvents
property. The documentation on all the
options and events supported by clockpicker can be found here., (*12)
License
The BSD License (BSD). Please see License File for more information., (*13)