本文整理汇总了PHP中kartik\date\DatePicker::className方法的典型用法代码示例。如果您正苦于以下问题:PHP DatePicker::className方法的具体用法?PHP DatePicker::className怎么用?PHP DatePicker::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kartik\date\DatePicker
的用法示例。
在下文中一共展示了DatePicker::className方法的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="book-update">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>
<?php
echo $form->field($model, 'name');
?>
<?php
echo $form->field($model, 'date')->widget(DatePicker::className(), ['value' => $model->getAttribute('date'), 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
<?php
echo $form->field($model, 'author_id')->dropDownList($authors);
?>
<?php
echo $form->field($model, 'preview')->widget(FileInput::className(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['showUpload' => false, 'initialPreview' => [Html::img($model->getImage(), ['class' => 'file-preview-image', 'alt' => $model->name, 'title' => $model->name])]]]);
?>
<div class="form-group">
<?php
echo Html::submitButton('Submit', ['class' => 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
示例3:
?>
<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]]);
示例4: function
/* @var $this \yii\web\View */
/* @var $model ExampleModel */
?>
<?php
$form = ActiveForm::begin(['enableAjaxValidation' => true, 'enableClientValidation' => false, 'validateOnChange' => false, 'validateOnSubmit' => true, 'validateOnBlur' => false]);
?>
<h3>Single column</h3>
<?php
echo $form->field($model, 'emails')->widget(MultipleInput::className(), ['limit' => 5])->label(false);
?>
<h3>Multiple columns</h3>
<?php
echo $form->field($model, 'schedule')->widget(MultipleInput::className(), ['id' => 'schedule-wrapper', 'limit' => 4, 'columns' => [['name' => 'user_id', 'type' => MultipleInputColumn::TYPE_DROPDOWN, 'enableError' => true, 'title' => 'User', 'defaultValue' => 33, 'items' => [31 => 'item 31', 32 => 'item 32', 33 => 'item 33', 34 => 'item 34', 35 => 'item 35', 36 => 'item 36']], ['name' => 'day', 'type' => DatePicker::className(), 'title' => 'Day', 'value' => function ($data) {
return $data['day'];
}, 'items' => ['0' => 'Saturday', '1' => 'Monday'], 'options' => ['pluginOptions' => ['format' => 'dd.mm.yyyy', 'todayHighlight' => true]], 'headerOptions' => ['style' => 'width: 250px;', 'class' => 'day-css-class']], ['name' => 'priority', 'title' => 'Priority', 'defaultValue' => 1, 'enableError' => true, 'options' => ['class' => 'input-priority']], ['name' => 'comment', 'type' => MultipleInputColumn::TYPE_STATIC, 'value' => function ($data) {
return Html::tag('span', 'static content', ['class' => 'label label-info']);
}, 'headerOptions' => ['style' => 'width: 70px;']], ['type' => MultipleInputColumn::TYPE_CHECKBOX_LIST, 'name' => 'enable', 'headerOptions' => ['style' => 'width: 80px;'], 'items' => [1 => 'Test 1', 2 => 'Test 2', 3 => 'Test 3', 4 => 'Test 4'], 'options' => ['unselect' => 2]]]]);
?>
<?php
echo Html::submitButton('Update', ['class' => 'btn btn-success']);
ActiveForm::end();
?>
<?php
$js = <<<JS
\$('#schedule-wrapper').on('afterInit', function(){
示例5:
?>
<?php
echo $form->field($model, 'name');
?>
<?php
echo $form->field($model, 'author_id')->dropDownList($authors, ['prompt' => 'Select author']);
?>
<?php
echo $form->field($model, 'date_from')->widget(DatePicker::className(), ['options' => ['placeholder' => Yii::t('app', 'Date from')], 'pluginOptions' => ['autoclose' => true, 'convertFormat' => false, 'format' => 'yyyy-mm-dd'], 'value' => $bookSearchFromDate]);
?>
<?php
echo $form->field($model, 'date_to')->widget(DatePicker::className(), ['options' => ['placeholder' => Yii::t('app', 'Date from')], 'pluginOptions' => ['autoclose' => true, 'convertFormat' => false, 'format' => 'yyyy-mm-dd'], 'value' => $bookSearchFromDate]);
?>
<div class="form-group">
<?php
echo Html::submitButton('Search', ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('Reset', ['index'], ['class' => 'btn btn-info']);
?>
<?php
echo Html::button('Create Book', ['value' => '/book/create', 'id' => 'createSnippet', 'class' => 'btn btn-success']);
?>
</div>
<?php
示例6: gmdate
* @var dektrium\user\models\User $user
* @var dektrium\user\models\Profile $profile
*/
?>
<?php
$this->beginContent('@lnch/users/views/admin/update.php', ['user' => $user]);
?>
<?php
$form = ActiveForm::begin(['layout' => 'horizontal', 'enableAjaxValidation' => true, 'enableClientValidation' => false, 'fieldConfig' => ['horizontalCssClasses' => ['wrapper' => 'col-sm-9']]]);
echo $form->field($profile, 'title')->dropDownList(Profile::$titles);
echo $form->field($profile, 'first_name');
echo $form->field($profile, 'middle_names');
echo $form->field($profile, 'surname', []);
echo $form->field($profile, 'date_of_birth')->widget(DatePicker::className(), ['options' => ['value' => gmdate("d/m/Y", strtotime($profile->date_of_birth))], 'layout' => "{picker}{input}{remove}", 'pluginOptions' => ['autoclose' => true, 'format' => "dd/mm/yyyy"]]);
echo $form->field($profile, 'website');
echo $form->field($profile, 'location');
echo $form->field($profile, 'job_title');
echo $form->field($profile, 'contact_number');
echo $form->field($profile, 'bio')->textarea();
?>
<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:
}']]);
?>
<?php
echo $form->field($model, 'toAmount')->textInput()->label('Величина (' . $firstValuta . ')*', ['id' => 'toAmountLabel']);
?>
</div>
</div>
</div>
<div class="row transfer-info-block">
<div class="col-md-12">
<?php
echo $form->field($model, 'date')->label($model->getAttributeLabel('date') . '*')->widget(DatePicker::className(), ['type' => DatePicker::TYPE_INPUT, 'pluginOptions' => ['autoclose' => true, 'format' => 'dd-mm-yyyy']]);
?>
<div class="row additionally-date">
<?php
echo Html::a('Вчера', 'javascript:void(0);', ['class' => 'additionally-date-link', 'data-value' => Yii::$app->getFormatter()->asDate('yesterday', "php:d-m-Y")]);
?>
<?php
echo Html::a('Сегодня', 'javascript:void(0);', ['class' => 'additionally-date-link', 'data-value' => Yii::$app->getFormatter()->asDate('now', "php:d-m-Y")]);
?>
</div>
<?php
echo $form->field($model, 'comment')->textInput([]);
?>
示例8:
?>
</div>
<div class="col-sm-12 col-md-3">
<?php
echo $form->field($model, 'content_date')->widget(DatePicker::className(), ['pluginOptions' => ['autoclose' => true], 'options' => ['class' => 'form-control', 'placeholder' => Yii::t('back', 'Date')]]);
?>
<?php
echo $form->field($model, 'content_time')->widget(TimePicker::className(), ['pluginOptions' => ['defaultTime' => false, 'showSeconds' => false, 'showMeridian' => false], 'options' => ['class' => 'form-control']]);
?>
<?php
echo $form->field($model, 'content_end_date')->widget(DatePicker::className(), ['pluginOptions' => ['autoclose' => true], 'options' => ['class' => 'form-control', 'placeholder' => Yii::t('back', 'End date')]]);
?>
<?php
echo $form->field($model, 'categoryBoxes')->checkboxList($model->getCategoryOptions());
?>
<?php
echo $form->field($model, 'boxes')->inline()->checkboxList([ArticleForm::PROPERTY_PUBLIC => Yii::t('back', 'Public'), ArticleForm::PROPERTY_ACTIVE => Yii::t('back', 'Active')], ['id' => 'modal-boxes', 'data-main' => 0]);
?>
<?php
echo $form->field($model, 'layout_id')->dropDownList($model->getLayoutListOptions());
?>
<div class="form-group">
示例9:
/* @var $model app\models\Book */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="book-form">
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'name')->textInput(['maxlength' => true])->label('Имя');
?>
<?php
echo $form->field($model, 'date')->widget(DatePicker::className(), ['options' => ['class' => $inputClasses], 'type' => DatePicker::TYPE_INPUT, 'pluginOptions' => ['format' => 'yyyy-mm-dd']])->label('Дата');
?>
<?php
echo $form->field($model, 'author_id')->dropDownList(ArrayHelper::map($authors, 'id', 'fullname'))->label('Автор');
?>
<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();
?>
示例10:
Pjax::begin(['timeout' => false, 'id' => 'annSearchForm']);
?>
<?php
$form = ActiveForm::begin(['method' => 'get', 'options' => ['data-pjax' => 1]]);
?>
<div class="row">
<div class="col-md-3">
<?php
echo $form->field($searchModel, 'title')->textInput();
?>
</div>
<div class="col-md-3">
<?php
echo $form->field($searchModel, 'created_at')->widget(DatePicker::className(), ['options' => ['placeholder' => Yii::t('announcement', 'Select publication date')], 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'viewSelect' => 'month', 'autoclose' => true, 'todayHighlight' => true]]);
?>
</div>
<div class="col-md-3">
<?php
echo $form->field($searchModel, 'category')->widget(Widget::className(), ['options' => ['multiple' => true, 'placeholder' => Yii::t('announcement', 'Choose category'), 'class' => 'form-control'], 'bootstrap' => true, 'settings' => ['width' => '100%'], 'items' => $categories]);
?>
</div>
<div class="col-md-3">
<?php
echo $form->field($searchModel, 'region')->widget(Widget::className(), ['options' => ['multiple' => true, 'placeholder' => Yii::t('announcement', 'Choose region'), 'class' => 'form-control'], 'settings' => ['width' => '100%'], 'items' => $regions]);
?>
</div>
<div class="col-md-12">
<?php
echo Html::submitButton(Yii::t('yii', 'Search'), ['class' => 'btn btn-default search']);
示例11: date
use kartik\select2\Select2;
use wbraganca\dynamicform\DynamicFormWidget;
use backend\models\Nos_analysoitavat;
/* @var $this yii\web\View */
/* @var $model backend\models\Nos */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="nos-form">
<?php
$form = ActiveForm::begin(['id' => 'dynamic-form']);
?>
<?php
echo $form->field($model, 'naytteenottopvm')->widget(DatePicker::className(), ['name' => 'deadline', 'type' => DatePicker::TYPE_COMPONENT_APPEND, 'removeButton' => ['title' => 'Tyhjennä'], 'pickerButton' => ['title' => 'Valitse päivä'], 'value' => date('yyyy-mm-dd'), 'options' => ['placeholder' => 'Valitse'], 'language' => 'fi', 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'todayHighlight' => true, 'startDate' => 'today', 'todayBtn' => true, 'multidate' => true]]);
?>
<?php
echo $form->field($model, 'tuote_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Tuote::find()->all(), 'id', 'nimi'), 'language' => 'fi', 'options' => ['placeholder' => 'Valitse'], 'pluginOptions' => ['allowClear' => true]]);
?>
<div class="row" style="width:80% display:table" >
<div class="panel panel-default">
<div class="panel-heading" style="width:80%" ><h4><i class="glyphicon glyphicon-option-vertical"></i> Analysoitavat bakteerit</h4></div>
示例12: date
?>
<?php
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'description')->textarea(['rows' => 6]);
?>
<?php
echo $form->field($model, 'url')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'date')->widget(DatePicker::className(), ['attribute' => 'date', 'name' => 'date', 'value' => date('Y-m-d'), 'options' => ['placeholder' => 'Оберіть місяць ...'], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
<br/><br/>
<div class="form-group">1
<?php
echo Html::submitButton($model->isNewRecord ? 'Створити' : 'Редагувати', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
示例13:
<?php
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>
<?php
echo $form->field($model, 'username')->textInput(['value' => $user->username, 'disabled' => true]);
?>
<?php
echo $form->field($model, 'email')->textInput(['value' => $user->email]);
?>
<?php
echo $form->field($model, 'full_name')->textInput(['placeholder' => "Nhập họ và tên", 'value' => $user->full_name]);
?>
<?php
echo $form->field($model, 'birthday')->widget(DatePicker::className(), ['name' => 'dp_2', 'type' => DatePicker::TYPE_COMPONENT_PREPEND, 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
<?php
echo $form->field($model, 'address')->textInput(['placeholder' => "Nhập địa chỉ", 'value' => $user->address]);
?>
<?php
echo $form->field($model, 'telephone')->textInput(['placeholder' => "Nhập số điện thoại", 'value' => $user->telephone]);
?>
<?php
echo $form->field($model, 'imageFile')->fileInput(['placeholder' => "Upload ảnh"]);
?>
<?php
echo $form->field($model, 'avatar')->textInput(['placeholder' => "Nhập a", 'value' => $user->avatar]);
?>
示例14:
<div class="alert alert-danger">Timesheet đã được Chấm điểm - Không thể add thêm</div>
<?php
}
?>
<?php
if (Yii::$app->session->hasFlash("WrongDate")) {
?>
<div class="alert alert-danger">Bạn không thể tạo timesheet cho ngày hôm sau</div>
<?php
}
?>
<?php
echo $form->field($model, 'date')->widget(DatePicker::className(), ['name' => 'dp_2', 'type' => DatePicker::TYPE_INPUT, 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
<?php
echo "<h2>Details</h2>";
?>
<?php
foreach ($modelDetails as $i => $modelDetail) {
?>
<div class="row work-detail work-detail-<?php
echo $i;
?>
">
<div class="col-md-2" style="width: auto"><?php
echo $form->field($modelDetail, "[{$i}]team_id")->widget(Select2::className(), ['theme' => 'bootstrap', 'data' => $teamlist, 'options' => ['placeholder' => 'Select team'], 'pluginOptions' => ['allowClear' => true]]);
?>
示例15:
<div class="col-md-6">
<?php
echo $form->field($model, 'name');
?>
</div>
</div>
<div class="row">
<div class="col-md-6">
<?php
echo $form->field($model, 'dateStart')->widget(DatePicker::className(), ['language' => 'ru', 'type' => DatePicker::TYPE_INPUT, 'options' => ['class' => 'form-control'], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
</div>
<div class="col-md-6">
<?php
echo $form->field($model, 'dateEnd')->widget(DatePicker::className(), ['language' => 'ru', 'type' => DatePicker::TYPE_INPUT, 'options' => ['class' => 'form-control'], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
</div>
</div>
<div class="form-group">
<div class="text-right">
<?php
echo Html::submitButton('Искать', ['class' => 'btn btn-primary']);
?>
<?php
echo Html::resetButton('Очистить', ['class' => 'btn btn-default']);
?>
</div>
</div>