本文整理汇总了PHP中yii\jui\DatePicker::className方法的典型用法代码示例。如果您正苦于以下问题:PHP DatePicker::className方法的具体用法?PHP DatePicker::className怎么用?PHP DatePicker::className使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\jui\DatePicker
的用法示例。
在下文中一共展示了DatePicker::className方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderInput
/**
* Формирование Html кода поля для вывода в форме
* @param ActiveForm $form объект форма
* @param array $options массив html атрибутов поля
* @param bool|int $index инднкс модели при табличном вводе
* @return string
*/
public function renderInput(ActiveForm $form, array $options = [], $index = false)
{
$options = ArrayHelper::merge($this->options, $options);
$widgetOptions = ArrayHelper::merge(["options" => ["class" => "form-control"]], $this->widgetOptions, ["options" => $options]);
$fieldOptions = ["options" => ["class" => "form-group col-xs-6"]];
$html = Html::beginTag('div', ['class' => 'row']);
$html .= $form->field($this->modelField->model, $this->fromAttr, $fieldOptions)->widget(DatePicker::className(), $widgetOptions);
$html .= $form->field($this->modelField->model, $this->toAttr, $fieldOptions)->widget(DatePicker::className(), $widgetOptions);
$html .= Html::endTag('div');
return $html;
}
示例2: editAttribute
/**
* @param $model - profile model
* @param $field - profile fields model item
* @param $htmlOptions - htmlOptions
* @return string
*/
public function editAttribute($model, $field, $htmlOptions = [])
{
if (!isset($htmlOptions['size'])) {
$htmlOptions['size'] = 60;
}
if (!isset($htmlOptions['maxlength'])) {
$htmlOptions['maxlength'] = $field->field_size ? $field->field_size : 10;
}
if (!isset($htmlOptions['id'])) {
$htmlOptions['id'] = get_class($model) . '_' . $field->varname;
}
// $this->params['dateFormat'] = 'yy-mm-dd';
$this->params['options']['class'] = 'form-control';
/** @var $afield ActiveForm*/
$field = $htmlOptions['formField'];
unset($htmlOptions['formField']);
return $field->widget(DatePicker::className(), $this->params);
}
示例3:
$form = ActiveForm::begin();
?>
<?php
foreach ($modelGS as $key => $gs) {
?>
<div class="panel panel-primary">
<div class="panel-heading">
<?php
echo 'Семестр : ' . $gs->semester_number;
?>
</div>
<div class="panel-body">
<?php
echo $form->field($gs, "[{$key}]begin_date")->widget(DatePicker::className(), ['options' => ['class' => 'form-control'], 'dateFormat' => 'dd-MM-yyyy', 'language' => 'ru']);
echo $form->field($gs, "[{$key}]end_date")->widget(DatePicker::className(), ['options' => ['class' => 'form-control'], 'dateFormat' => 'dd-MM-yyyy', 'language' => 'ru']);
?>
</div>
</div>
<?php
}
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
示例4:
?>
<?php
echo $form->field($searchModel, 'name');
?>
<?php
echo $form->field($searchModel, 'author_id')->dropDownList($authors, ['prompt' => ''])->label(Yii::t('app', 'Автор'));
?>
<?php
echo Yii::t('app', 'Дата выхода книги');
?>
<?php
echo $form->field($searchModel, 'date_from')->widget(DatePicker::className(), ['language' => 'ru', 'dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['changeMonth' => true, 'yearRange' => '1900:2099', 'changeYear' => true]]);
?>
<?php
echo $form->field($searchModel, 'date_to')->widget(DatePicker::className(), ['language' => 'ru', 'dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['changeMonth' => true, 'yearRange' => '1900:2099', 'changeYear' => true]]);
?>
<div class="form-group">
<?php
echo Html::submitButton(Yii::t('app', 'Искать'), ['class' => 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
<p>
示例5: Participant
<!-- Modal -->
<div class="modal fade" id="appointModal" tabindex="-1" role="dialog" aria-labelledby="consentModal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Change appointment date</h4>
</div>
<div class="modal-body">
<?php
$model = new Participant();
?>
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'appoint_date')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd', 'options' => ['class' => 'form-control'], 'clientOptions' => ['changeMonth' => true, 'changeYear' => true, 'minDate' => 'today']]);
?>
</div>
<div class="modal-footer">
<input type="hidden" value="" id="idparticipant2" />
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" onClick="updateAppoint()">Submit</button>
</div>
</div>
</div>
</div>
示例6:
'class' => 'uborder disabled help-30percent']) ?>
</div>
</div>
<?= $form->field($model, 'truck_van', ['template' => '<div class="control-group">{label}<div class="f-inline-size">{input}</div><div class=\"col-lg-8\">{error}</div></div>'])->textInput(['maxlength' => 10,
'class' => 'uborder help-20percent',
'onchange' => 'setFieldValueToUpperCaseById(this.id, this.value);'])->label('T.PLATE #') ?>
<?= $form->field($model, 'plant_location', ['template' => '<div class="control-group">{label}<div class="f-inline-size">{input}</div><div class=\"col-lg-8\">{error}</div></div>'])->textInput(['value' => Yii::$app->user->identity->assignment,
'readonly' => 'readonly',
'class' => 'uborder disabled help-40percent'])->label('P. Loc') ?>
<?= $form->field($model, 'storage_location', ['template' => '<div class="control-group">{label}<div class="f-inline-size">{input}</div><div class=\"col-lg-8\">{error}</div></div>'])->dropDownList($storage_list, ['class' => 'uborder help-40percent',
'prompt' => '-- Select a storage --'])->label('S. Loc'); ?>
<?= $form->field($model,'actual_gr_date',['template' => '<div class="control-group">{label}<div class="f-inline-size">{input}</div><div class=\"col-lg-8\">{error}</div></div>'])->widget(DatePicker::className(),[
'language' => 'en-GB',
'clientOptions' => ['dateFormat' => 'dd-M-yy',
'showOn' => 'button',
'buttonImage' => '../images/calendar.gif',
'buttonImageOnly' => 'true',],
'options' => ['class' => 'uborder disabled help-25percent dateclass',
'readonly' => 'readonly',
'dateFormat' => 'dd-M-yy',]]) ?>
<?= $form->field($model, 'remarks',
['template' => '<div class="control-group">{label}<div class="f-inline-size">
<label class="class="control-label">' . Yii::$app->user->identity->username . '@:</label>
{input}</div><div class=\"col-lg-8\">{error}</div></div>'])->textarea(['rows'=>'5']) ?>
示例7:
</div>
<?php
}
?>
</div>
<div class="col-lg-6">
<?php
echo $form->field($model, 'task_start')->widget(\yii\jui\DatePicker::className(), ['options' => ['class' => 'form-control', 'readonly' => 'readonly'], 'dateFormat' => 'dd MMMM yyyy', 'clientOptions' => ['minDate' => 0, 'changeMonth' => true, 'changeYear' => true]]);
?>
<?php
echo $form->field($model, 'task_end')->widget(\yii\jui\DatePicker::className(), ['options' => ['class' => 'form-control', 'readonly' => 'readonly'], 'dateFormat' => 'dd MMMM yyyy', 'clientOptions' => ['minDate' => 0, 'changeMonth' => true, 'changeYear' => true]]);
?>
<?php
echo $form->field($model, 'status')->dropDownList(Status::getTaskStatusList(), ['prompt' => 'Pilih']);
?>
<?php
echo $form->field($model, 'period')->dropDownList(Status::getPeriodList(), ['prompt' => 'Pilih']);
?>
</div>
<div class="col-lg-12">
<div class="form-group">
示例8:
</div>
<div class="box-body"><?php
$form = ActiveForm::begin(['requiredCssClass' => 'form-group-required']);
?>
<div class="row">
<div class="col-md-6">
<?php
echo $form->field($searchModel, 'entry_date_from')->widget(DatePicker::className(), ['inline' => false, 'dateFormat' => $phpFmShortDateGui, 'options' => ['class' => 'form-control']]);
?>
<?php
echo $form->field($searchModel, 'account_source')->dropDownList($arrFinAccount, ['prompt' => '']);
?>
</div>
<div class="col-md-6">
<?php
echo $form->field($searchModel, 'entry_date_to')->widget(DatePicker::className(), ['inline' => false, 'dateFormat' => $phpFmShortDateGui, 'options' => ['class' => 'form-control']]);
?>
<?php
echo $form->field($searchModel, 'account_target')->dropDownList($arrFinAccount, ['prompt' => '']);
?>
</div>
<div class="col-md-6"><div class="form-group">
<?php
echo Html::submitButton(Yii::t('button', 'Search'), ['class' => 'btn btn-info', 'name' => MasterValueUtils::SM_MODE_NAME, 'value' => MasterValueUtils::SM_MODE_INPUT]);
?>
</div></div>
<div class="col-md-6"><table class="table table-bordered"><thead><tr>
<th class="warning" style="text-align: left; width: 120px"><?php
echo Yii::t('fin.grid', 'This Month');
?>
</th>
示例9: function
<div class="model">
<?php
echo $form->errorSummary([$customer, $reservation]);
?>
<h2>Customer</h2>
<?php
echo $form->field($customer, 'name')->textInput();
echo $form->field($customer, 'surname')->textInput();
echo $form->field($customer, 'phone_number')->textInput();
?>
<h2>Reservation</h2>
<?php
echo $form->field($reservation, 'room_id')->dropDownList(ArrayHelper::map(Room::find()->all(), 'id', function ($room) {
return sprintf('Room #%d. Floor #%d', $room->room_number, $room->floor);
}));
echo $form->field($reservation, 'price_per_day')->textInput();
echo $form->field($reservation, 'date_from')->widget(DatePicker::className(), ['dateFormat' => 'yyyy/MM/dd']);
echo $form->field($reservation, 'date_to')->widget(DatePicker::className(), ['dateFormat' => 'yyyy/MM/dd']);
?>
</div>
<div class="form-group">
<?php
echo Html::submitButton('Send', ['class' => 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
示例10:
</div>
<div class="form-group col-lg-3">
<?php
echo $form->field($model, 'book_name')->label('Book name');
?>
</div>
</div>
<div class="row">
<div class="form-group col-lg-3">
<?php
echo $form->field($model, 'book_published_from')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['defaultDate' => '2014-01-01'], 'options' => ['class' => 'form-control'], 'value' => $model->book_published_from]);
?>
</div>
<div class="form-group col-lg-3">
<?php
echo $form->field($model, 'book_published_to')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['defaultDate' => '2015-01-01'], 'options' => ['class' => 'form-control'], 'value' => $model->book_published_to]);
?>
</div>
</div>
<div class="row">
<div class="form-group col-lg-6">
<?php
echo Html::submitButton('Search', ['class' => 'btn btn-primary pull-right']);
?>
</div>
</div>
<?php
ActiveForm::end();
?>
<?php
if (!empty($books)) {
示例11:
use yii\jui\DatePicker;
/* @var $this \yii\web\View */
/* @var $historyModel \app\modules\discount\models\history */
/* @var $items \app\modules\discount\models\History[] */
$this->title = 'История посещений:';
?>
<div class="row-fluid">
<div class="col-md-7">
<div class="well well-sm">
<?php
$form = ActiveForm::begin(['options' => ['class' => 'form-inline']]);
?>
<?php
echo $form->field($historyModel, 'dateUse')->widget(DatePicker::className(), ['language' => 'ru', 'dateFormat' => 'yyyy-MM-dd', 'options' => ['class' => 'form-control']]);
?>
<?php
echo Html::submitButton('Применить', ['class' => 'btn btn-success']);
?>
| <?php
echo Html::a('Сбросить фильтр', ['/discount/user/client-history']);
?>
<?php
ActiveForm::end();
?>
</div>
</div>
</div>
示例12:
<div class="row">
<div class="col-md-1">
<?php
echo $form->field($model, 'visible')->checkbox(['label' => 'Активен']);
?>
</div>
<div class="col-md-6">
<?php
echo $form->field($model, 'type')->dropDownList(\app\modules\cms\models\Article::typeList(), ['prompt' => 'Выбор']);
?>
</div>
<div class="col-md-5">
<?php
echo $form->field($model, 'dateCreate')->widget(\yii\jui\DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd', 'options' => ['class' => 'form-control']]);
?>
</div>
</div>
<div class="row">
<div class="col-md-6">
<?php
echo $form->field($model, 'title')->textInput(['maxlength' => 128]);
?>
</div>
<div class="col-md-6">
<?php
echo $form->field($model, 'alias')->textInput(['maxlength' => 128]);
?>
</div>
示例13:
<div class = "col-sm-4 col-xs-12">
<?php
echo $form->field($info, 'emp_gender', ['inputOptions' => ['class' => 'form-control', 'placeholder' => $model->getAttributeLabel('emp_gender')]])->dropDownList($info->getGenderOptions(), ['prompt' => Yii::t('stu', '--- Select Gender ---')]);
?>
</div>
<div class = "col-sm-4 col-xs-12">
<?php
echo $form->field($info, 'emp_dob')->widget(yii\jui\DatePicker::className(), ['model' => $info, 'attribute' => 'emp_dob', 'clientOptions' => ['dateFormat' => 'dd-mm-yyyy', 'changeMonth' => true, 'yearRange' => '1900:' . (date('Y') + 1), 'changeYear' => true, 'readOnly' => true, 'autoSize' => true, 'buttonImage' => Yii::$app->homeUrl . "images/calendar.png"], 'options' => ['class' => 'form-control']])->label(true);
?>
</div>
</div>
<div class="col-xs-12 col-lg-12 col-sm-12">
<div class = "col-sm-4 col-xs-12">
<?php
echo $form->field($info, 'emp_joining_date')->widget(yii\jui\DatePicker::className(), ['model' => $info, 'attribute' => 'emp_joining_date', 'clientOptions' => ['dateFormat' => 'dd-mm-yyyy', 'changeMonth' => true, 'yearRange' => '1900:' . (date('Y') + 1), 'changeYear' => true, 'readOnly' => true, 'autoSize' => true, 'buttonImage' => Yii::$app->homeUrl . "images/calendar.png"], 'options' => ['class' => 'form-control']])->label(true);
?>
</div>
<div class = "col-sm-4 col-xs-12">
<?php
echo $form->field($model, 'emp_master_department_id')->dropDownList(ArrayHelper::map(app\modules\employee\models\EmpDepartment::find()->where(['is_status' => 0])->all(), 'emp_department_id', 'emp_department_name'), ['prompt' => Yii::t('emp', '--- Select Department ---')]);
?>
</div>
<div class="col-sm-4 col-xs-12">
<?php
echo $form->field($model, 'emp_master_designation_id')->dropDownList(ArrayHelper::map(app\modules\employee\models\EmpDesignation::find()->where(['is_status' => 0])->all(), 'emp_designation_id', 'emp_designation_name'), ['prompt' => Yii::t('emp', '--- Select Designation ---')]);
?>
</div>
</div>
<div class="col-xs-12 col-lg-12 col-sm-12">
示例14: renderInput
/**
* Формирование Html кода поля для вывода в форме
* @param ActiveForm $form объект форма
* @param array $options массив html атрибутов поля
* @param bool|int $index инднкс модели при табличном вводе
* @return string
*/
public function renderInput(ActiveForm $form, array $options = [], $index = false)
{
$options = ArrayHelper::merge($this->options, $options);
$widgetOptions = ArrayHelper::merge(["options" => ["class" => "form-control"]], $this->widgetOptions, ["options" => $options]);
return $form->field($this->modelField->model, $this->getFormAttrName($index, $this->modelField->attr))->widget(DatePicker::className(), $widgetOptions);
}
示例15:
</div>
<?php
$form = ActiveForm::begin(['action' => ['/catalog/reservation/step-one'], 'enableAjaxValidation' => true, 'options' => ['class' => 'product-form']]);
?>
<div class="row">
<div class="col-md-6">
<?php
echo $form->field($formModel, 'dateIn')->widget(DatePicker::className());
?>
</div>
<div class="col-md-6">
<?php
echo $form->field($formModel, 'dateOut')->widget(DatePicker::className());
?>
</div>
</div>
<div class="row">
<div class="col-md-4"><?php
echo $form->field($formModel, 'email')->textInput();
?>
</div>
<div class="col-md-4"><?php
echo $form->field($formModel, 'name')->textInput();
?>
</div>
<div class="col-md-4"><?php
echo $form->field($formModel, 'phone')->textInput();