本文整理汇总了PHP中kartik\date\DatePicker类的典型用法代码示例。如果您正苦于以下问题:PHP DatePicker类的具体用法?PHP DatePicker怎么用?PHP DatePicker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DatePicker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
use yii\bootstrap\ActiveForm;
use unclead\widgets\TabularInput;
use yii\helpers\Html;
use unclead\widgets\examples\models\Item;
/* @var $this \yii\web\View */
/* @var $models Item[] */
?>
<?php
$form = \yii\bootstrap\ActiveForm::begin(['id' => 'tabular-form', 'enableAjaxValidation' => true, 'enableClientValidation' => false, 'validateOnChange' => false, 'validateOnSubmit' => true, 'validateOnBlur' => false, 'options' => ['enctype' => 'multipart/form-data']]);
?>
<?php
echo TabularInput::widget(['models' => $models, 'attributeOptions' => ['enableAjaxValidation' => true, 'enableClientValidation' => false, 'validateOnChange' => false, 'validateOnSubmit' => true, 'validateOnBlur' => false], 'columns' => [['name' => 'title', 'title' => 'Title', 'type' => \unclead\widgets\MultipleInputColumn::TYPE_TEXT_INPUT], ['name' => 'description', 'title' => 'Description'], ['name' => 'file', 'title' => 'File', 'type' => \vova07\fileapi\Widget::className(), 'options' => ['settings' => ['url' => ['site/fileapi-upload']]]], ['name' => 'date', 'type' => \kartik\date\DatePicker::className(), 'title' => 'Day', 'options' => ['pluginOptions' => ['format' => 'dd.mm.yyyy', 'todayHighlight' => true]], 'headerOptions' => ['style' => 'width: 250px;', 'class' => 'day-css-class']]]]);
?>
<?php
echo Html::submitButton('Update', ['class' => 'btn btn-success']);
ActiveForm::end();
示例2:
?>
<div class="priskhead-form">
<?php
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>
<?php
echo $form->field($model, 'ref')->hiddenInput(['maxlength' => 50])->label(false);
?>
<div class="row">
<div class="col-sm-6 col-md-6">
<?php
echo $form->field($model, 'risk_date')->widget(DatePicker::className(), ['language' => 'th', 'options' => ['placeholder' => 'Select issue date ...'], 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'todayHighlight' => true]]);
?>
</div>
<div class="col-xs-4 col-sm-2 col-md-2">
<?php
echo $form->field($model, 'risk_time')->textInput(['maxlength' => true]);
?>
</div>
<div class="col-xs-6 col-sm-4 col-md-6">
<?php
echo $form->field($model, 'department')->widget(Select2::classname(), ['data' => ArrayHelper::map(Adddep::find()->all(), 'ADDDEP_ID', 'DEP_NAME'), 'options' => ['placeholder' => 'เลือกแแผนก ...'], 'pluginOptions' => ['allowClear' => true]]);
示例3: date
<?php
echo $form->field($model, 'location')->textInput(['class' => 'placepicker form-control']);
?>
<?php
echo $form->field($model, 'eopen_date')->widget(DateTimePicker::className(), ['name' => 'eopen_date', 'options' => ['placeholder' => 'Select Entries open time ...'], 'convertFormat' => true, 'pluginOptions' => ['orientation' => 'top', 'format' => 'd-M-y hh:i ', 'startDate' => date('yyyy-MM-dd hh:ii:ss'), 'autoclose' => true, 'todayHighlight' => true]]);
?>
<?php
echo $form->field($model, 'eclose_date')->widget(DateTimePicker::className(), ['name' => 'eclose_date', 'options' => ['placeholder' => 'Select Entries close time ...'], 'convertFormat' => true, 'pluginOptions' => ['orientation' => 'top', 'format' => 'd-M-y hh:i ', 'autoclose' => true, 'startDate' => date('yyyy-MM-dd hh:ii:ss'), 'todayHighlight' => true]]);
?>
<?php
echo DatePicker::widget(['model' => $model, 'name' => 'from_date', 'attribute' => 'start_date', 'attribute2' => 'end_date', 'options' => ['placeholder' => 'Select Event start date ...'], 'options2' => ['placeholder' => 'Select Event end date ...'], 'value' => '01-Feb-1996', 'type' => DatePicker::TYPE_RANGE, 'name2' => 'to_date', 'value2' => '27-Feb-1996', 'pluginOptions' => ['autoclose' => true, 'format' => 'dd-M-yyyy']]);
?>
<p></p>
<h4>
<span class="label label-info">By Clicking the Create button the Event will be automatically posted on HorseBuzz mobile app</span>
</h4>
<p></p>
<di"form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-danger' : 'btn btn-primary']);
?>
</div>
示例4:
use app\components\grid\LinkColumn;
use app\modules\admin\modules\users\models\User;
use kartik\date\DatePicker;
use app\modules\admin\modules\users\Module;
/* @var $this yii\web\View */
/* @var $searchModel \app\modules\admin\modules\users\models\search\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Module::t('module', 'ADMIN_USERS');
$this->params['breadcrumbs'][] = ['label' => Module::t('module', 'ADMIN'), 'url' => ['/admin/default/index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="admin-users-default-index">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
// echo $this->render('_search', ['model' => $searchModel]);
?>
<?php
$gridColumn = [['class' => 'yii\\grid\\SerialColumn'], ['filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_from', 'attribute2' => 'date_to', 'type' => DatePicker::TYPE_RANGE, 'separator' => '<i class="glyphicon glyphicon-arrow-right"></i>', 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'todayHighlight' => true]]), 'attribute' => 'created_at', 'format' => ['date', 'php:d M Y г., H:i:s']], ['class' => LinkColumn::className(), 'attribute' => 'username'], 'email:email', ['class' => SetColumn::className(), 'filter' => User::getStatusesArray(), 'attribute' => 'status', 'name' => 'statusName', 'cssCLasses' => [User::STATUS_ACTIVE => 'success', User::STATUS_WAIT => 'warning', User::STATUS_BLOCKED => 'default']], ['filter' => User::getRolesArray(), 'attribute' => 'role', 'value' => 'RoleName'], ['class' => ActionColumn::className()]];
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumn, 'responsive' => true, 'hover' => true, 'pjax' => false, 'resizableColumns' => true, 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['class' => 'btn btn-default', 'title' => Module::t('module', 'RESET_GRID')])], '{toggleData}'], 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-user"></i> ' . Html::encode($this->title) . '</h3>', 'type' => 'primary', 'before' => Html::a('<i class="glyphicon glyphicon-plus"></i> ' . Module::t('module', 'BUTTON_CREATE'), ['create'], ['class' => 'btn btn-success', 'data-pjax' => 0])]]);
?>
</div>
示例5:
?>
<?php
echo $form->field($model, 'administrador_id')->dropDownList(ArrayHelper::map(Administrador::find()->all(), 'id', 'Nombres'), ['prompt' => 'Seleccionar Administrador', 'style' => 'width:300px']);
?>
<?php
echo $form->field($model, 'hora_inicio')->widget(TimePicker::className(), ['pluginOptions' => ['format' => 'HH:MM', 'showMeridian' => false, 'minuteStep' => 1], 'options' => ['style' => 'width:260px'], 'addonOptions' => ['asButton' => true, 'inline-addon' => true]]);
?>
<?php
echo $form->field($model, 'tiempo_periodo')->textInput(['style' => 'width:300px']);
?>
<?php
echo $form->field($model, 'fecha')->widget(DatePicker::className(), ['removeButton' => false, 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd'], 'options' => ['style' => 'width:260px']]);
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Crear' : 'Actualizar', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
示例6: function
ช่วง 1 เมษายน 2558 ถึง 31 มีนาคม 2559) เกณฑ์เป้าหมายน้อยกว่า 6.63 (รหัสที่ให้ J45-J46)</font></p></h6>
</div>
<?php
$form = ActiveForm::begin(['layout' => 'inline']);
?>
<div class="form-group">
<label class="control-label"> เลือกวันที่ </label>
<?php
echo DatePicker::widget(['name' => 'date1', 'value' => $date1, 'language' => 'th', 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'changeMonth' => true, 'changeYear' => true, 'todayHighlight' => true]]);
?>
</div>
<div class="form-group">
<label class="control-label"> ถึง </label>
<?php
echo DatePicker::widget(['name' => 'date2', 'value' => $date2, 'language' => 'th', 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'changeMonth' => true, 'changeYear' => true, 'todayHighlight' => true]]);
?>
</div>
<div class="form-group">
<?php
echo Html::submitButton('ประมวลผล', ['class' => 'btn btn-warning btn-flat']);
?>
</div><!-- /.input group -->
<?php
ActiveForm::end();
?>
<br>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'panel' => ['type' => GridView::TYPE_DEFAULT], 'responsive' => true, 'hover' => true, 'floatHeader' => true, 'pjax' => true, 'pjaxSettings' => ['neverTimeout' => true, 'beforeGrid' => '', 'afterGrid' => ''], 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'village_name', 'header' => 'หมู่บ้าน'], ['label' => 'เป้าหมาย (คน)', 'format' => 'raw', 'value' => function ($model) {
return Html::a(Html::encode($model['b']), ['/qof/qof/goal202', 'id' => $model['village_id']]);
示例7: date
<div class="books-form">
<?php
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>
<?php
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'preview')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['showPreview' => true, 'showCaption' => true, 'showRemove' => true, 'showUpload' => false]]);
?>
<?php
echo $form->field($model, 'date')->widget(DatePicker::classname(), ['value' => date('Y-m-d', strtotime('today')), 'options' => ['placeholder' => Yii::t('books', 'select Date')], 'pluginOptions' => ['hideInput' => true, 'format' => 'yyyy-mm-dd', 'todayHighlight' => true]]);
?>
<?php
echo $form->field($model, 'author_id')->dropDownList(ArrayHelper::map(Authors::find()->all(), 'id', 'fullName'), ['prompt' => Yii::t('books', 'select Author')]);
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
示例8:
<?php
use yii\grid\GridView;
use yii\helpers\Html;
use yii\widgets\Pjax;
use kartik\date\DatePicker;
$this->title = '学校列表';
?>
<p>
<?php
echo Html::a('<i class="fa fa-plus"></i> 添加学校', ['school/add'], ['class' => 'btn btn-primary']);
?>
</p>
<div class="row">
<div class="col-lg-12">
<?php
Pjax::begin();
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'tableOptions' => ['class' => 'table table-striped table-bordered table-center'], 'summaryOptions' => ['tag' => 'p', 'class' => 'text-right text-info'], 'columns' => [['class' => 'yii\\grid\\SerialColumn', 'headerOptions' => ['class' => 'col-md-1']], ['attribute' => 'name', 'headerOptions' => ['class' => 'col-md-7'], 'filterInputOptions' => ['class' => 'form-control input-sm']], ['attribute' => 'created_at', 'format' => ['date', 'php:Y-m-d H:i'], 'filter' => DatePicker::widget(['model' => $searchModel, 'type' => DatePicker::TYPE_COMPONENT_APPEND, 'attribute' => 'date', 'options' => ['class' => 'input-sm'], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]), 'headerOptions' => ['class' => 'col-md-3']], ['class' => 'yii\\grid\\ActionColumn', 'header' => '操作', 'headerOptions' => ['class' => 'col-md-1'], 'template' => '{update}']]]);
?>
<?php
Pjax::end();
?>
</div>
</div>
示例9: date
?>
<?php
echo $form->field($model, 'status')->checkbox($options = ['status' => 1])->hint('Встановити після вказання вихідного номеру (після встановлення та збереження, редагування моніторигу буде неможливе)');
?>
<!-- --><?php
//= $form->field($model, 'year_id')->dropDownList(ArrayHelper::map($years, 'id', 'year'), ['prompt' => 'Оберіть рік', 'onchange' => 'getMonthByYear(this.value);', 'disabled' => $model->isNewRecord ? false : true ])
?>
<!-- --><?php
//= $form->field($model, 'month_id')->dropDownList(ArrayHelper::map($months, 'id', 'month'), ['prompt' => 'Оберіть місяць', 'id' => 'month_id', 'disabled' => $model->isNewRecord ? false : true ])
?>
<?php
echo $form->field($model, 'date')->widget(DatePicker::className(), ['disabled' => $model->isNewRecord ? false : true, 'attribute' => 'date', 'name' => 'date', 'value' => date('Y-m-d'), 'options' => ['placeholder' => 'Оберіть місяць ...'], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm', 'viewMode' => 'Months', 'minViewMode' => 'months']]);
?>
<!-- --><?php
// echo '<label>Check Issue Date</label>';
// echo DatePicker::widget([
// 'attribute' => 'date',
// 'name' => 'date',
// 'value' => date('Y-m-d'),
// 'options' => ['placeholder' => 'Оберіть місяць ...'],
// 'pluginOptions' => [
// 'autoclose'=>true,
// 'format' => 'yyyy-mm-dd',
//// 'viewMode' => 'Months',
//// 'minViewMode' => 'months',
//// 'todayHighlight' => true
// ]
示例10: function
<p>
<?php
echo Html::a('<i class="fa fa-plus"></i> 添加营业点', ['store/add'], ['class' => 'btn btn-primary']);
?>
</p>
<div class="row">
<div class="col-lg-12">
<?php
Pjax::begin();
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'tableOptions' => ['class' => 'table table-striped table-bordered table-center'], 'summaryOptions' => ['tag' => 'p', 'class' => 'text-right text-info'], 'columns' => [['class' => 'yii\\grid\\SerialColumn', 'headerOptions' => ['class' => 'col-md-1']], ['attribute' => 'name', 'headerOptions' => ['class' => 'col-md-2'], 'filterInputOptions' => ['class' => 'form-control input-sm']], ['attribute' => 'school_id', 'headerOptions' => ['class' => 'col-md-3'], 'filterInputOptions' => ['class' => 'form-control input-sm'], 'value' => function ($model, $key, $index, $column) {
return $model->school->name;
}, 'filter' => Select2::widget(['model' => $searchModel, 'initValueText' => ($school = School::findOne($searchModel->school_id)) ? $school->name : '', 'attribute' => 'school_id', 'size' => Select2::SMALL, 'theme' => Select2::THEME_KRAJEE, 'options' => ['placeholder' => '搜索学校名称...'], 'pluginOptions' => ['allowClear' => true, 'minimumInputLength' => 3, 'ajax' => ['url' => Url::to(['/school/name-filter']), 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {q:params.term}; }')], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), 'templateResult' => new JsExpression('function (store) { return store.text; }'), 'templateSelection' => new JsExpression('function (store) { return store.text; }')]])], ['attribute' => 'address', 'headerOptions' => ['class' => 'col-md-2'], 'filterInputOptions' => ['class' => 'form-control input-sm']], ['attribute' => 'status', 'format' => 'raw', 'filter' => Store::getStatusList(), 'filterInputOptions' => ['class' => 'form-control input-sm'], 'headerOptions' => ['class' => 'col-md-1'], 'value' => function ($model, $key, $index, $column) {
return Html::dropDownList('status', $model->status, Store::getStatusList(), ['data-id' => $model->id]);
}], ['attribute' => 'created_at', 'format' => ['date', 'php:Y-m-d H:i'], 'filter' => DatePicker::widget(['model' => $searchModel, 'type' => DatePicker::TYPE_COMPONENT_APPEND, 'attribute' => 'date', 'options' => ['class' => 'input-sm'], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]), 'headerOptions' => ['class' => 'col-md-2']], ['class' => 'yii\\grid\\ActionColumn', 'header' => '操作', 'headerOptions' => ['class' => 'col-md-1'], 'template' => '{update} {view}']]]);
?>
<?php
Pjax::end();
?>
</div>
</div>
<?php
$url = Url::to(['/store/status']);
$js = <<<JS
var handle = function () {
var id = \$(this).attr('data-id');
var status = \$(this).val();
\$.ajax({
url: '{$url}?id=' + id ,
type: 'post',
示例11: function
</p>
<p class="pull-right">
<?php
echo Html::a('<i class="glyphicon glyphicon-th-large"></i> ' . Module::t('module', 'BUTTON_CATEGORIES'), ['category/index'], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('<i class="glyphicon glyphicon-tags"></i> ' . Module::t('module', 'BUTTON_TAGS'), ['tags/index'], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('<i class="glyphicon glyphicon-comment"></i> ' . Module::t('module', 'BUTTON_COMMENTS') . ' <span class="badge">' . $countPending . '</span>', ['comment/index'], ['class' => 'btn btn-primary']);
?>
</p>
</div>
</div>
<?php
$gridColumn = [['class' => 'yii\\grid\\SerialColumn'], ['class' => LinkColumn::className(), 'attribute' => 'title'], ['attribute' => 'author_id', 'label' => Module::t('module', 'LABEL_AUTHOR'), 'format' => 'text', 'content' => function ($data) {
return $data->getAuthorName();
}, 'filter' => Post::getAuthorList()], ['filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_from', 'attribute2' => 'date_to', 'type' => DatePicker::TYPE_RANGE, 'separator' => '-', 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'todayHighlight' => true]]), 'attribute' => 'created_at', 'format' => ['date', 'php:d M Y г., H:i:s']], ['filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'dateUpd_from', 'attribute2' => 'dateUpd_to', 'type' => DatePicker::TYPE_RANGE, 'separator' => '-', 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'todayHighlight' => true]]), 'attribute' => 'updated_at', 'format' => ['date', 'php:d M Y г., H:i:s']], ['class' => SetColumn::className(), 'attribute' => 'publish_status', 'filter' => Post::getStatusesArray(), 'name' => function ($model) {
return Post::getStatusTitle($model->publish_status);
}, 'cssCLasses' => [Post::STATUS_PUBLISH => 'success', Post::STATUS_DRAFT => 'default', Post::STATUS_ARCHIVE => 'info']], ['attribute' => 'category_id', 'label' => Module::t('module', 'LABEL_CATEGORY'), 'format' => 'text', 'content' => function ($data) {
return $data->getCategoryTitle();
}, 'filter' => Post::getCategoryList()], ['class' => ActionColumn::className()]];
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumn, 'responsive' => true, 'hover' => true, 'pjax' => false, 'resizableColumns' => true, 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['class' => 'btn btn-default', 'title' => Module::t('module', 'RESET_GRID')])], '{toggleData}'], 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-th-list"></i> ' . Html::encode($this->title) . '</h3>', 'type' => 'primary', 'before' => Html::a('<i class="glyphicon glyphicon-plus"></i> ' . Module::t('module', 'BUTTON_CREATE'), ['create'], ['class' => 'btn btn-success', 'data-pjax' => 0])]]);
?>
</div>
示例12:
use app\modules\admin\Module;
use app\components\grid\SetColumn;
use kartik\date\DatePicker;
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel \app\modules\admin\models\search\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Module::t('module', 'ADMIN_USERS');
$this->params['breadcrumbs'][] = ['label' => Module::t('module', 'ADMIN'), 'url' => ['default/index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="users-index">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a(Module::t('module', 'ADMIN_USERS_ADD'), ['create'], ['class' => 'btn btn-success']);
?>
</p>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', ['filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_from', 'attribute2' => 'date_to', 'type' => DatePicker::TYPE_RANGE, 'separator' => '-', 'pluginOptions' => ['format' => 'yyyy-mm-dd']]), 'attribute' => 'created_at', 'format' => 'datetime', 'filterOptions' => ['style' => 'max-width: 180px']], ['class' => LinkColumn::className(), 'attribute' => 'username'], 'email:email', ['class' => SetColumn::className(), 'filter' => User::getStatusesArray(), 'attribute' => 'status', 'name' => 'statusName', 'cssCLasses' => [User::STATUS_ACTIVE => 'success', User::STATUS_WAIT => 'warning', User::STATUS_BLOCKED => 'default']], ['class' => ActionColumn::className()]]]);
?>
</div>
示例13:
<?php
use yii\bootstrap\ActiveForm;
use unclead\multipleinput\TabularInput;
use yii\helpers\Html;
use unclead\multipleinput\examples\models\Item;
use unclead\multipleinput\TabularColumn;
/* @var $this \yii\web\View */
/* @var $models Item[] */
?>
<?php
$form = \yii\bootstrap\ActiveForm::begin(['id' => 'tabular-form', 'options' => ['enctype' => 'multipart/form-data']]);
?>
<?php
echo TabularInput::widget(['models' => $models, 'attributeOptions' => ['enableAjaxValidation' => true, 'enableClientValidation' => false, 'validateOnChange' => false, 'validateOnSubmit' => true, 'validateOnBlur' => false], 'form' => $form, 'columns' => [['name' => 'id', 'type' => TabularColumn::TYPE_HIDDEN_INPUT], ['name' => 'title', 'title' => 'Title', 'type' => TabularColumn::TYPE_TEXT_INPUT, 'attributeOptions' => ['enableClientValidation' => true, 'validateOnChange' => true], 'defaultValue' => 'Test', 'enableError' => true], ['name' => 'description', 'title' => 'Description'], ['name' => 'date', 'type' => \kartik\date\DatePicker::className(), 'title' => 'Day', 'options' => ['pluginOptions' => ['format' => 'dd.mm.yyyy', 'todayHighlight' => true]], 'headerOptions' => ['style' => 'width: 250px;', 'class' => 'day-css-class']]]]);
?>
<?php
echo Html::submitButton('Update', ['class' => 'btn btn-success']);
ActiveForm::end();
示例14:
}
?>
<?php
$form = ActiveForm::begin();
?>
<div class="row">
<div class="col-sm-3">
<?php
echo DatePicker::widget(['model' => $model, 'attribute' => 'startDate', 'readonly' => true, 'form' => $form, 'removeButton' => false, 'pluginOptions' => ['autoClose' => true, 'format' => 'yyyy-mm-dd']]);
?>
</div>
<div class="col-sm-3">
<?php
echo DatePicker::widget(['model' => $model, 'attribute' => 'endDate', 'readonly' => true, 'form' => $form, 'removeButton' => false, 'pluginOptions' => ['autoClose' => true, 'format' => 'yyyy-mm-dd']]);
?>
</div>
</div>
<div class="form-group">
<?php
echo Html::submitButton('View', ['class' => 'btn btn-success', 'id' => 'view_button']);
?>
</div>
<?php
ActiveForm::end();
?>
<?php
echo '</div>';
示例15:
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
// echo $this->render('_search', ['model' => $searchModel]);
?>
<p>
<?php
echo Html::a('Create Mon1str', ['create'], ['class' => 'btn btn-success']);
?>
</p>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'region', 'value' => 'monitoring1.user.profile.region.number', 'filter' => Html::activeDropDownList($searchModel, 'region', ArrayHelper::map(\app\models\Region::find()->asArray()->all(), 'id', 'number'), ['class' => 'form-control', 'prompt' => 'Оберіть код регіону'])], ['attribute' => 'date', 'value' => 'date', 'format' => 'raw', 'width' => '350px', 'filter' => DatePicker::widget(['model' => $searchModel, 'name' => 'date', 'attribute' => 'date', 'options' => ['placeholder' => 'Оберіть місяць ...'], 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'viewMode' => 'months', 'minViewMode' => 'months']])], ['class' => 'yii\\grid\\ActionColumn']]]);
?>
<?php
$m = Yii::$app->request->get();
$excel = ['excel'];
$arrayExcel = ArrayHelper::merge($excel, $m);
?>
<p>
<?php
echo Html::a('Емпортувати в xls', $arrayExcel, ['class' => 'btn btn-success']);
?>
</p>
</div>