本文整理汇总了PHP中kartik\datecontrol\DateControl::className方法的典型用法代码示例。如果您正苦于以下问题:PHP DateControl::className方法的具体用法?PHP DateControl::className怎么用?PHP DateControl::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kartik\datecontrol\DateControl
的用法示例。
在下文中一共展示了DateControl::className方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
?>
<div class="row">
<div class="col-sm-12">
<?php
$form = ActiveForm::begin(['fieldClass' => ActiveField::className()]);
?>
<?php
echo $form->field($model, 'date_from')->widget(DateControl::className(), ['type' => DateControl::FORMAT_DATE, 'language' => Yii::$app->language]);
?>
<?php
echo $form->field($model, 'date_to')->widget(DateControl::className(), ['type' => DateControl::FORMAT_DATE, 'language' => Yii::$app->language]);
?>
<?php
echo $form->field($model, 'time_from')->widget(TimePicker::className(), ['pluginOptions' => ['defaultTime' => false, 'showSeconds' => false, 'showMeridian' => false], 'options' => ['class' => 'form-control']]);
?>
<?php
echo $form->field($model, 'time_to')->widget(TimePicker::className(), ['pluginOptions' => ['defaultTime' => false, 'showSeconds' => false, 'showMeridian' => false], 'options' => ['class' => 'form-control']]);
?>
<?php
echo $form->field($model, 'hour_length')->widget(Spinner::className());
?>
<div class="form-group">
示例2:
?>
<div class="persona-search">
<?php
$form = ActiveForm::begin(['action' => ['index'], 'method' => 'get', 'layout' => 'inline']);
?>
<?php
echo $form->field($model, 'fecdesde')->widget(DateControl::className(), ['type' => DateControl::FORMAT_DATE, 'options' => ['options' => ['placeholder' => 'Desde fecha'], 'id' => 'fcd', 'pluginEvents' => ['clearDate' => 'function(e) {
$("#fcd").val("");
}']]]);
?>
<?php
echo $form->field($model, 'fechasta')->widget(DateControl::className(), ['type' => DateControl::FORMAT_DATE, 'options' => ['options' => ['placeholder' => 'Hasta fecha'], 'id' => 'fch', 'pluginEvents' => ['clearDate' => 'function(e) {
$("#fch").val("");
}']]]);
?>
<div class="form-group">
<?php
echo Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']);
?>
<?php
//Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default'])
?>
<?php
ActiveForm::end();
?>
示例3: JsExpression
* @var $dataProvider \yii\data\ActiveDataProvider
*/
$this->title = "Биллинг";
?>
<div class="billing">
<?php
echo Html::pageHeader($this->title);
?>
<?php
$form = ActiveForm::begin(['id' => 'billing-form', 'method' => 'get', 'layout' => 'inline']);
?>
<?php
echo $form->field($searchModel, 'periodInput')->widget(DateControl::className(), ['type' => DateControl::FORMAT_DATE, 'options' => ['options' => ['placeholder' => 'Период...'], 'pluginOptions' => ['autoclose' => true, 'minViewMode' => 1]], 'saveFormat' => 'php:n' . $searchModel::PERIOD_DELIMITER . 'Y', 'displayFormat' => 'php:F Y']);
?>
<?php
echo $form->field($searchModel, 'operatorId')->dropDownList($searchModel::operatorList());
?>
<?php
echo $form->field($searchModel, 'items')->widget(Select2::className(), ['showToggleAll' => false, 'options' => ['multiple' => true, 'placeholder' => 'Номер или имя сотрудника...'], 'pluginOptions' => ['width' => '600', 'allowClear' => true, 'minimumInputLength' => 3, 'ajax' => ['url' => \yii\helpers\Url::to(['items-list']), 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {q:params.term}; }'), 'delay' => 250], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), 'templateResult' => new JsExpression('function(item) {return item.number; }'), 'templateSelection' => new JsExpression('function (item) {return item.number; }')]]);
?>
<?php
echo Html::submitButton('<span class="glyphicon glyphicon-search"></span>', ['class' => 'btn btn-primary']);
?>
<?php
示例4:
</div>
<div class="row">
<div class="col-lg-3">
Periodo: <?php
echo $periodo_a_pagar;
?>
</div>
</div>
</div>
<div class="center">
<h4>Detalles de pago</h4>
<div class="row">
<div class="col-lg-6"><?php
echo $form->field($model, 'fecha_pago')->widget(DateControl::className(), ['type' => DateControl::FORMAT_DATE]);
?>
</div>
</div>
<div class="row">
<div class="col-lg-6"><?php
echo $form->field($model, 'medio')->dropDownList(ArrayHelper::map(MedioPago::find()->all(), 'id', 'nombre'));
?>
</div>
</div>
<div class="row">
<div class="col-lg-6"><?php
echo $form->field($model, 'valor')->widget(MaskMoney::className(), ['pluginOptions' => ['prefix' => '$ ', 'suffix' => '', 'thousands' => '.', 'decimal' => ',', 'allowNegative' => false]]);
?>
示例5:
<?php
echo Yii::t('app', 'Notification Settings');
?>
</a></li>
<li role="presentation">
<a href="#form_theme_settings" aria-controls="form_theme_settings" role="tab" data-toggle="tab">
<?php
echo Yii::t('app', 'UI Settings');
?>
</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="form_settings">
<?php
echo FormGrid::widget(['model' => $formModel, 'form' => $form, 'autoGenerateColumns' => true, 'columnSize' => Form::SIZE_TINY, 'rows' => [['contentBefore' => Html::tag('legend', Yii::t('app', 'Form Settings'), ['class' => 'text-primary']), 'attributes' => ['name' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => Yii::t("app", "Enter the form name...")]]]], ['attributes' => ['status' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\switchinput\\SwitchInput', 'hint' => Yii::t("app", "Disables the form at any time.")], 'language' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\select2\\Select2', 'hint' => Yii::t("app", "This language will be used to display your form messages."), 'options' => ['data' => \app\helpers\Language::supportedLanguages()]]]], ['attributes' => ['message' => ['type' => Form::INPUT_TEXTAREA, 'hint' => Yii::t("app", "Message displayed to the user when the form is disabled."), 'options' => ['placeholder' => Yii::t("app", "Enter message...")]]]], ['attributes' => ['schedule' => ['type' => Form::INPUT_RAW, 'value' => $form->field($formModel, 'schedule')->radioButtonGroup([$formModel::ON => Yii::t('app', 'Yes'), $formModel::OFF => Yii::t('app', 'No')], ['itemOptions' => ['labelOptions' => ['class' => 'btn btn-primary']], 'style' => 'display:block; margin-bottom:15px; overflow:hidden'])]]], ['attributes' => ['schedule_start_date' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => \kartik\datecontrol\DateControl::className(), 'options' => ['type' => \kartik\datecontrol\DateControl::FORMAT_DATETIME, 'displayTimezone' => Yii::$app->timeZone, 'options' => ['options' => ['placeholder' => 'Select start date...']]]], 'schedule_end_date' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => \kartik\datecontrol\DateControl::className(), 'options' => ['type' => \kartik\datecontrol\DateControl::FORMAT_DATETIME, 'displayTimezone' => Yii::$app->timeZone, 'options' => ['options' => ['placeholder' => 'Select end date...']]]]]], ['contentBefore' => Html::tag('legend', Yii::t('app', 'Advanced Options'), ['class' => 'text-primary']), 'attributes' => ['save' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\switchinput\\SwitchInput', 'hint' => Yii::t("app", "Saves all form submissions in the database.")], 'analytics' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\switchinput\\SwitchInput', 'hint' => Yii::t("app", "Enable Form Tracking.")], 'honeypot' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\switchinput\\SwitchInput', 'hint' => Yii::t("app", "Adds a hidden text field to filter spam.")], 'resume' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\switchinput\\SwitchInput', 'hint' => Yii::t("app", "Auto save incomplete form filling and resume later.")]]], ['contentBefore' => Html::tag('legend', Yii::t('app', 'Submission Limit'), ['class' => 'text-primary']), 'attributes' => ['total_limit' => ['type' => Form::INPUT_RAW, 'value' => $form->field($formModel, 'total_limit')->radioButtonGroup([$formModel::ON => Yii::t('app', 'Yes'), $formModel::OFF => Yii::t('app', 'No')], ['itemOptions' => ['labelOptions' => ['class' => 'btn btn-primary']], 'style' => 'display:block; margin-bottom:15px; overflow:hidden'])]]], ['attributes' => ['total_limit_number' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => Yii::t("app", "Enter the total number...")]], 'total_limit_period' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\select2\\Select2', 'options' => ['data' => $formModel->getTimePeriods(), 'pluginOptions' => ['placeholder' => Yii::t('app', 'Select time period'), 'allowClear' => true]]]]], ['attributes' => ['ip_limit' => ['type' => Form::INPUT_RAW, 'value' => $form->field($formModel, 'ip_limit')->radioButtonGroup([$formModel::ON => Yii::t('app', 'Yes'), $formModel::OFF => Yii::t('app', 'No')], ['itemOptions' => ['labelOptions' => ['class' => 'btn btn-primary']], 'style' => 'display:block; margin-bottom:15px; overflow:hidden'])]]], ['attributes' => ['ip_limit_number' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => Yii::t("app", "Enter the max number...")]], 'ip_limit_period' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\select2\\Select2', 'options' => ['data' => $formModel->getTimePeriods(), 'pluginOptions' => ['placeholder' => Yii::t('app', 'Select time period'), 'allowClear' => true]]]]]]]);
?>
</div>
<div role="tabpanel" class="tab-pane fade" id="form_confirmation_settings">
<?php
echo FormGrid::widget(['model' => $formConfirmationModel, 'form' => $form, 'autoGenerateColumns' => true, 'rows' => [['contentBefore' => Html::tag('legend', Yii::t('app', 'Confirmation Settings'), ['class' => 'text-primary']), 'attributes' => ['type' => ['type' => Form::INPUT_RAW, 'value' => $form->field($formConfirmationModel, 'type')->radioButtonGroup($formConfirmationModel->getTypes(), ['itemOptions' => ['labelOptions' => ['class' => 'btn btn-primary']], 'style' => 'display:block; margin-bottom:15px; overflow:hidden'])]]], ['attributes' => ['message' => ['type' => Form::INPUT_TEXTAREA, 'options' => ['placeholder' => Yii::t("app", "Your Confirmation Message...")]]]], ['attributes' => ['url' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => Yii::t("app", "Enter URL...")]]]], ['attributes' => ['send_email' => ['type' => Form::INPUT_RAW, 'value' => $form->field($formConfirmationModel, 'send_email')->radioButtonGroup([$formConfirmationModel::CONFIRM_BY_EMAIL_ENABLE => Yii::t('app', 'Yes'), $formConfirmationModel::CONFIRM_BY_EMAIL_DISABLE => Yii::t('app', 'No')], ['itemOptions' => ['labelOptions' => ['class' => 'btn btn-primary']], 'style' => 'display:block; margin-bottom:15px; overflow:hidden'])]]], ['attributes' => ['mail_to' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\select2\\Select2', 'hint' => Yii::t("app", "Your form must have an email field to use this feature."), 'options' => ['data' => $emailFields, 'options' => ['placeholder' => Yii::t("app", "Select an e-mail field...")], 'pluginOptions' => ['allowClear' => true]]], 'mail_from' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => Yii::t("app", "Enter your e-mail address...")]], 'mail_from_name' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => Yii::t("app", "Enter your name or company...")]]]], ['attributes' => ['mail_subject' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => Yii::t("app", "Enter subject...")]]]], ['attributes' => ['mail_message' => ['type' => Form::INPUT_TEXTAREA, 'hint' => Yii::t("app", "Allowed HTML Tags:") . ' ' . Html::encode('<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>'), 'options' => ['placeholder' => Yii::t("app", "Your Confirmation Message by E-Mail...")]]]], ['attributes' => ['mail_receipt_copy' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\switchinput\\SwitchInput', 'hint' => '']]]]]);
?>
</div>
<div role="tabpanel" class="tab-pane fade" id="form_notification_settings">
<?php
echo FormGrid::widget(['model' => $formEmailModel, 'form' => $form, 'autoGenerateColumns' => true, 'rows' => [['contentBefore' => Html::tag('legend', Yii::t('app', 'To Email Address'), ['class' => 'text-primary']), 'attributes' => ['subject' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => Yii::t("app", "Enter subject...")]]]], ['attributes' => ['to' => ['type' => Form::INPUT_TEXT, 'hint' => Yii::t("app", "Notifications wil be e-mailed to this address, e.g. 'admin@example.com'."), 'options' => ['placeholder' => Yii::t("app", "Enter e-mail address...")]], 'from' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\select2\\Select2', 'options' => ['data' => $emails]]]], ['attributes' => ['cc' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => Yii::t("app", "Enter e-mail address...")]], 'bcc' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => Yii::t("app", "Enter e-mail address...")]]]], ['autoGenerateColumns' => false, 'columns' => 12, 'attributes' => ['type' => ['columnOptions' => ['colspan' => 6], 'type' => Form::INPUT_RAW, 'value' => $form->field($formEmailModel, 'type')->radioButtonGroup([$formEmailModel::TYPE_ALL => Yii::t("app", "All Data"), $formEmailModel::TYPE_LINK => Yii::t("app", "Only Link"), $formEmailModel::TYPE_MESSAGE => Yii::t("app", "Custom Message")], ['itemOptions' => ['labelOptions' => ['class' => 'btn btn-primary']], 'style' => 'display:block; margin-bottom:15px; overflow:hidden'])->hint(Yii::t("app", "This email may contain all submitted data,\n a link to saved data or a custom message."))], 'attach' => ['columnOptions' => ['colspan' => 3], 'type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\switchinput\\SwitchInput', 'hint' => ''], 'plain_text' => ['columnOptions' => ['colspan' => 3], 'type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\switchinput\\SwitchInput', 'hint' => '']]], ['attributes' => ['message' => ['type' => Form::INPUT_TEXTAREA, 'hint' => Yii::t("app", "Allowed HTML Tags:") . ' ' . Html::encode('<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>'), 'options' => ['placeholder' => Yii::t("app", "Enter your custom message...")]]]]]]);
?>
</div>
<div role="tabpanel" class="tab-pane fade" id="form_theme_settings">
<?php
echo FormGrid::widget(['model' => $formUIModel, 'form' => $form, 'autoGenerateColumns' => true, 'columnSize' => Form::SIZE_TINY, 'rows' => [['contentBefore' => Html::tag('legend', Yii::t('app', 'UI Settings'), ['class' => 'text-primary']), 'attributes' => ['js_file' => ['type' => Form::INPUT_TEXT, 'hint' => Yii::t("app", "This custom javascript file will be loaded each time the form is being displayed."), 'options' => ['placeholder' => Yii::t("app", "Enter URL...")]]]], ['attributes' => ['theme_id' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\select2\\Select2', 'label' => Yii::t('app', 'Select a Theme'), 'hint' => Yii::t("app", "Select the theme that fits best to your form."), 'options' => ['data' => $themes, 'pluginOptions' => ['placeholder' => Yii::t('app', 'Select a Theme'), 'allowClear' => true], 'pluginEvents' => ["select2:select" => "previewSelected", "select2:unselect" => "previewUnselected"]]]]]]]);
示例6:
?>
<?php
echo $form->field($model, 'has_conditioner')->textInput();
?>
<?php
echo $form->field($model, 'has_tv')->textInput();
?>
<?php
echo $form->field($model, 'has_phone')->textInput();
?>
<?php
echo $form->field($model, 'available_from')->widget(DateControl::className(), ['type' => DateControl::FORMAT_DATE]);
?>
<?php
echo $form->field($model, 'price_per_day')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'description')->textarea(['rows' => 6]);
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
示例7: foreach
</div>
<div class="panel-body">
<p>
Вы можете указать дату рождения <strong>ИЛИ</strong> возраст ребенка. Неиспользуемые поля оставьте пустыми
</p>
</div>
<?php
$form = ActiveForm::begin(['layout' => 'horizontal', 'enableAjaxValidation' => true, 'enableClientValidation' => false, 'fieldConfig' => ['horizontalCssClasses' => ['wrapper' => 'col-sm-9']]]);
?>
<ul class="list-group">
<?php
foreach ($children as $index => $child) {
?>
<li class="list-group-item">
<?php
echo $form->field($child, "[{$index}]BirthDay")->widget(\kartik\datecontrol\DateControl::className(), ['type' => \kartik\datecontrol\DateControl::FORMAT_DATE, 'displayFormat' => 'php:d-M-Y', 'saveFormat' => 'php:U', 'options' => ['pluginOptions' => ['autoclose' => true]]]);
?>
<?php
echo $form->field($child, "[{$index}]Birth")->input('number');
?>
</li>
<?php
}
?>
</ul>
<div class="panel-footer">
<div class="form-group">
<div class="col-md-offset-3 col-md-6">
<?php
echo \common\widgets\ButtonLink::widget(['label' => 'Пропустить', 'url' => ['/accounts/charge-balance', 'id' => $model->account->id]]);
?>