本文整理汇总了PHP中dosamigos\datepicker\DatePicker::className方法的典型用法代码示例。如果您正苦于以下问题:PHP DatePicker::className方法的具体用法?PHP DatePicker::className怎么用?PHP DatePicker::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dosamigos\datepicker\DatePicker
的用法示例。
在下文中一共展示了DatePicker::className方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
/**
* Поле выбора даты
* @return string
* @throws \Exception
*/
public function date()
{
if ($this->model->getIsNewRecord()) {
$this->model->{$this->attribute} = time();
}
$this->model->{$this->attribute} = date('d.m.Y', $this->model->{$this->attribute});
return $this->widget(DatePicker::className(), ['model' => $this->model, 'attribute' => $this->attribute, 'clientOptions' => ['autoclose' => true, 'format' => 'dd.mm.yyyy']]);
}
示例2: function
<?php
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'author_id')->dropDownList(ArrayHelper::map(Author::find()->orderBy(['lastname' => SORT_ASC])->asArray()->all(), 'id', function ($model, $defaultValue) {
return $model['lastname'] . ' ' . $model['firstname'];
}), ['prompt' => '---выберите автора---']);
?>
<?php
$model->date = preg_replace('/(\\d{4})-(\\d{2})-(\\d{2})/', '\\3.\\2.\\1', $model->date);
?>
<?php
echo $form->field($model, 'date')->hint('пример: 04.12.1975 (число.месяц.год)')->widget(DatePicker::className(), ['template' => '{addon}{input}', 'language' => 'ru', 'clientOptions' => ['autoclose' => true, 'format' => 'dd.mm.yyyy', 'todayHighlight' => true]]);
?>
<?php
if ($model->preview != null) {
?>
<div class="form-group">
<?php
echo Html::img(Yii::$app->params['frontendAbsoluteURL'] . $model->preview, ['id' => 'preview', 'class' => 'img-rounded']);
?>
</div>
<?php
}
?>
<?php
示例3:
?>
<?php
echo $form->field($model, 'company_name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'company_email')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'company_address')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'company_start_date')->widget(DatePicker::className(), ['inline' => false, 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
<?php
echo $form->field($model, 'file')->fileInput();
?>
<?php
echo $form->field($model, 'company_status')->dropDownList(['active' => 'Active', 'inactive' => 'Inactive'], ['prompt' => '- Status -']);
?>
<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>
示例4:
?>
<?php
echo $form->field($model, 'numPeriodo')->textInput(['style' => 'width:130px']);
?>
<?php
echo $form->field($model, 'anoPeriodo')->textInput(['style' => 'width:130px']);
?>
<?php
echo $form->field($model, 'dataInicioPeriodo')->widget(DatePicker::className(), ['inline' => false, 'language' => 'pt', 'template' => '{addon}{input}', 'options' => ['style' => 'width:130px'], 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
<?php
echo $form->field($model, 'dataFimPeriodo')->widget(DatePicker::className(), ['inline' => false, 'language' => 'pt', 'template' => '{addon}{input}', 'options' => ['style' => 'width:130px'], 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
<?php
echo $form->field($model, 'usaLaboratorio')->checkbox();
?>
<?php
echo $form->field($model, 'qtdVagas')->textInput(['style' => 'width:130px']);
?>
<?php
echo $form->field($model, 'qtdMonitorBolsista')->textInput(['style' => 'width:130px']);
?>
<?php
示例5:
<?= $form->field($model, 'allowance_amount')->textInput() ?>
<?= $form->field($model, 'allowance_remark')->textInput(['maxlength' => true]) ?>
<?= $form->field($model,'allowance_school_id')->widget(Select2::classname(),
[
'data'=>ArrayHelper::map(Schools::find()->all(), 'School_id','school_name'),
'language'=>'en',
'options'=>['placeholder'=>'Select School Name'],
'pluginOptions'=>['allowClear'=>true],
]) ?>
<?= $form->field($model, 'allowance_payStatus')->dropDownList([ 'paid' => 'Paid', 'not paid' => 'Not paid', ], ['prompt' => 'Select Payment Status']) ?>
<?= $form->field($model, 'allowance_paidDate')->widget(
DatePicker::className(), [
// inline too, not bad
'inline' => false,
// modify template for custom rendering
// 'template' => '<div class="well well-sm" style="background-color: #fff; width:250px">{input}</div>',
'clientOptions' => [
'autoclose' => true,
'format' => 'yyyy-mm-dd'
]
]);?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
示例6:
if ($profile->photo) {
?>
<?php
echo "<img width='100'src='http://wemamastest.ru.mastertest.ru/web/" . $profile->photo . "' />";
?>
<?php
}
?>
<?php
echo $form->field($profile, 'file')->fileInput();
?>
<?php
echo $form->field($profile, 'location');
?>
<?php
echo $form->field($profile, 'birthday')->widget(DatePicker::className(), ['inline' => false, 'clientOptions' => ['autoclose' => false, 'format' => 'yyyy-mm-dd']]);
?>
<?php
echo $form->field($profile, 'subscribe')->widget(CheckboxX::classname());
?>
<div class="form-group">
<div class="col-lg-offset-3 col-lg-9">
<?php
echo Html::submitButton(Yii::t('user', 'Update'), ['class' => 'btn btn-block btn-success']);
?>
</div>
</div>
示例7:
<div >
<label class="col-lg-2 control-label">Nouveau Bureau:</label>
<?php
echo $form->field($bureau, 'codebureau', ['horizontalCssClasses' => ['wrapper' => 'col-sm-3']])->dropDownList(ArrayHelper::map(Bureau::find()->asArray()->all(), 'codebureau', 'codebureau'), ['prompt' => '----------Choisir le bureau----------'])->label(false);
?>
</div>
<div>
<label for="DateTrans" class="col-lg-2 control-label">Date de transfert:</label>
<?php
echo $form->field($trans, 'dt')->widget(DatePicker::className(), ['template' => '{addon}{input}', 'clientOptions' => ['autoclose' => true, 'format' => 'dd/mm/yyyy']])->label(false);
?>
</div>
<div >
<label for="motif" class="col-lg-2 control-label">Motif du transfert:</label>
<?php
echo $form->field($trans, 'motif')->textarea()->label(false);
?>
</div>
示例8:
<div class="book-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')->fileInput();
?>
<?php
echo $form->field($model, 'date')->widget(DatePicker::className(), ['inline' => true, 'template' => '<div class="well well-sm" style="background-color: #fff; width:250px">{input}</div>', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
<?php
$authors = \app\models\Author::find()->all();
foreach ($authors as $author) {
$data[$author->id] = $author->lastname . ' ' . $author->firstname;
}
echo $form->field($model, 'author_id')->widget(\kartik\select2\Select2::className(), ['data' => $data, 'options' => ['placeholder' => 'Выберите автора']]);
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
示例9:
use yii\widgets\ActiveForm;
use auction\components\helpers\DatabaseHelper;
use dosamigos\datepicker\DatePicker;
/* @var $this yii\web\View */
/* @var $model auction\models\Auctions */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="auctions-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'start_date')->widget(DatePicker::className(),[
'template' => '{addon}{input}',
'clientOptions' => [
'autoclose' => true,
'format' => 'yyyy-mm-dd',
'disableEntry'=>true,
],
'options' => [
'data-pjax' => false
]
]) ?>
<?= $form->field($model, 'duration')->textInput() ?>
<?= $form->field($model, 'amount')->textInput() ?>
示例10:
?>
<?php
echo $form->field($model, 'company_email')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'company_address')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'logo')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'company_created_date')->widget(DatePicker::className(), ['inline' => false, 'clientOptions' => ['autoclose' => true, 'format' => 'dd-M-yyyy']]);
?>
<?php
echo $form->field($model, 'company_status')->dropDownList(['active' => 'Active', 'inactive' => 'Inactive'], ['prompt' => '']);
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
示例11:
?>
<?php
echo $form->field($model, 'id_role')->dropDownList(ArrayHelper::map(Role::find()->all(), 'id', 'title'))->label('Должность сотрудника');
?>
<?php
echo $form->field($model, 'birthday')->widget(DatePicker::className(), ['inline' => false, 'language' => 'ru', 'clientOptions' => ['autoclose' => true, 'format' => 'dd.mm.yyyy']]);
?>
<?php
echo $form->field($model, 'date_start')->widget(DatePicker::className(), ['inline' => false, 'language' => 'ru', 'clientOptions' => ['autoclose' => true, 'format' => 'dd.mm.yyyy']]);
?>
<?php
echo $form->field($model, 'date_end')->widget(DatePicker::className(), ['inline' => false, 'language' => 'ru', 'clientOptions' => ['autoclose' => true, 'format' => 'dd.mm.yyyy']]);
?>
<?php
echo $form->field($model, 'id_phone_code')->dropDownList(ArrayHelper::map(PhoneCode::find()->all(), 'id', 'code'))->label('Код телефона');
?>
<?php
echo $form->field($model, 'phone_number')->widget(MaskedInput::className(), ['name' => 'phone_number', 'mask' => '999-99-99', 'clientOptions' => ['removeMaskOnSubmit' => true]]);
?>
<?php
echo $form->field($model, 'id_department')->dropDownList(ArrayHelper::map(Deparment::find()->all(), 'id', 'title'))->label('Секция');
?>
示例12:
<div class="panel panel-primary">
<div class="panel-heading"><h4><i class="glyphicon glyphicon-shopping-cart"></i> Input Transaksi</h4></div>
<div class="panel-body">
<?php
$form = ActiveForm::begin(['id' => 'dynamic-form']);
?>
<div class="row">
<div class="col-sm-6">
<?php
// $form->field($modelTransaksi, 'kode_transaksi')->textInput()->label('No Faktur')
?>
</div>
<div class="col-sm-6">
<?php
echo $form->field($modelTransaksi, 'tanggal')->widget(DatePicker::className(), ['clientOptions' => ['autoclose' => true, 'format' => 'dd-M-yyyy']])->label('Tanggal Transaksi');
?>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<?php
echo $form->field($modelTransaksi, 'id_pelanggan')->dropDownList($modelTransaksi->KodePelanggan(), ['prompt' => 'Select...'])->label('Nama Pelanggan');
?>
</div>
<div class="col-sm-6">
<?php
echo $form->field($modelTransaksi, 'id_teknisi')->dropDownList($modelTransaksi->Pegawai(), ['prompt' => 'Select...'])->label('Nama Teknisi');
示例13:
/* @var $this yii\web\View */
/* @var $model backend\models\searches\NewsSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="news-search">
<?php
$form = ActiveForm::begin(['action' => ['index'], 'method' => 'get']);
?>
<?php
echo $form->field($model, 'created_at')->widget(DatePicker::className(), ['language' => 'zh-CN', 'clientOptions' => ['format' => 'yyyy-MM-dd']]);
?>
<?php
echo $form->field($model, 'updated_at')->widget(DatePicker::className(), ['language' => 'zh-CN', 'clientOptions' => ['format' => 'yyyy-MM-dd']]);
?>
<?php
//echo $form->field($model, 'created_at')
?>
<?php
//echo $form->field($model, 'updated_at')
?>
<div class="form-group">
<?php
echo Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']);
?>
<?php
echo Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']);
示例14:
<div class="form-group search_box_right">
<?php
echo Html::a(Yii::t('app', 'Create Books'), ['create'], ['class' => 'btn btn-success', 'data-pjax' => '0', 'data-toggle' => 'modal', 'data-target' => '#create_modal']);
?>
<div class="modal fade" id="create_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog"><div class="modal-content"></div></div>
</div>
</div>
<div style="clear:both;">
<?php
echo $form->field($model, 'book_date_from')->label('Дата выхода книги:', ['class' => 'search_author_date_label'])->widget(DatePicker::className(), ['addon' => '', 'language' => 'ru', 'clientOptions' => ['autoclose' => true, 'format' => 'dd/mm/yyyy']])->textInput(['class' => 'form-control search_author_date_input', 'placeholder' => '31/12/2014']);
?>
<?php
echo $form->field($model, 'book_date_to')->label('до', ['class' => 'search_author_date_label_two'])->widget(DatePicker::className(), ['addon' => '', 'language' => 'ru', 'clientOptions' => ['autoclose' => true, 'format' => 'dd/mm/yyyy']])->textInput(['class' => 'form-control search_author_date_input', 'placeholder' => '31/02/2015']);
?>
</div>
<div class="form-group search_box_right">
<?php
echo Html::submitButton(Yii::t('app', 'Искать'), ['class' => 'btn btn-primary search_btn']);
?>
</div>
<div style="clear:both;"></div>
<?php
ActiveForm::end();
?>
</div>
示例15:
$form = ActiveForm::begin();
?>
<div class="col-lg-4">
<?php
echo $form->field($affect, 'numAffectation')->textInput();
?>
</div>
<div class="col-lg-4">
<?php
echo $form->field($dat, 'dt')->widget(DatePicker::className(), ['template' => '{addon}{input}', 'clientOptions' => ['autoclose' => true, 'format' => 'dd/mm/yyyy']])->label("Date d'affectation");
?>
</div>
<div class="col-lg-4">
<?php
echo $form->field($bureau, 'codebureau', ['horizontalCssClasses' => ['wrapper' => 'col-sm-3']])->dropDownList(ArrayHelper::map(Bureau::find()->asArray()->all(), 'codebureau', 'codebureau'), ['prompt' => '----------Choisir le bureau----------']);
?>
</div>
<div class="col-lg-12">
<?php