launcherx / yii2-widget-cronui
Widget for generating cron string
2.0.3
2020-03-31 12:45 UTC
Requires
- launcherx/bootstrap-cronui: ~2.0
- npm-asset/bootstrap-select: ~1.13
This package is auto-updated.
Last update: 2025-03-01 00:16:04 UTC
README
Widget for generating cron string
Installation
The preferred way to install this extension is through composer.
Either run
$ php composer.phar require launcherx/yii2-widget-cronui "*"
or add
"launcherx/yii2-widget-cronui": "*"
to the `
require`
section of your composer.json
file.
Usage
Initialization
You can use this widget in an [[yii\bootstrap\ActiveForm|ActiveForm]] using the [[yii\widgets\ActiveField::widget()|widget()]] method, for example like this:
#!php
<?= $form->field($model, 'item_id')->widget(\launcherx\cronui\CronUI::classname(), [
'options' => [
'class' => 'form-control',
],
'pluginOptions' => [
'dropDownMultiple' => true,
'dropDownStyled' => true
]
]) ?>
Extension options
Default extension options
'pluginOptions' => [
'initial' => '* * * * *',
'dropDownMultiple' => false,
'dropDownStyled' => false,
'dropDownSizeClass' => 'col-md-2'
]
Name | Type | Default | Description |
---|---|---|---|
initial | string | ` '* * * * *'` | The initial option allows you the set the initial cron value. |
dropDownMultiple | boolean | false | Allow to choose multiple values in dropdown |
dropDownStyled | boolean | false | Style dropdowns using bootstrap-select plugin |
dropDownStyledFlat | boolean | false | Style dropdowns without border radius |
dropDownSizeClass | string | 'col-md-2' | Set dropdown column size |
License
Copyright (c) 2017 Imants Cernovs under the MIT License.