本文整理汇总了PHP中yii\widgets\MaskedInput::className方法的典型用法代码示例。如果您正苦于以下问题:PHP MaskedInput::className方法的具体用法?PHP MaskedInput::className怎么用?PHP MaskedInput::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\widgets\MaskedInput
的用法示例。
在下文中一共展示了MaskedInput::className方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array_merge
echo $form->field($model, 'cargo')->widget(Select2::classname(), ['data' => array_merge(["" => ""], $data_cargos), 'options' => ['placeholder' => 'Selecione o cargo...'], 'pluginOptions' => ['allowClear' => true]]);
?>
<?php
echo $form->field($model, 'nome')->textInput(['maxlength' => true, 'placeholder' => 'Nome completo...']);
?>
<?php
echo $form->field($model, "datanascimento")->widget(DateControl::classname(), ['type' => DateControl::FORMAT_DATETIME, 'displayFormat' => 'dd/MM/yyyy', 'autoWidget' => false, 'widgetClass' => 'yii\\widgets\\MaskedInput', 'options' => ['mask' => '99/99/9999', 'options' => ['class' => 'form-control', 'placeholder' => 'Data nascimento...']]]);
?>
<?php
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 4, 'attributes' => ['cpf' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Informe seu CPF...']], 'identidade' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Informe seu RG...']], 'orgao_exped' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Informe o orgão expedidor...']], 'sexo' => ['type' => Form::INPUT_RADIO_LIST, 'items' => [true => 'Masculino', false => 'Feminino'], 'options' => ['inline' => true]]]]);
?>
<?php
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 4, 'attributes' => ['email' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Informe seu e-mail...']], 'emailAlt' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Informe seu e-mail alternativo...']], 'telefone' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Informe seu telefone...']], 'telefoneAlt' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Informe seu telefone alternativo...']]]]);
?>
<?php
$form->field($model, 'cpf')->hiddenInput()->widget(\yii\widgets\MaskedInput::className(), ['mask' => '999.999.999-99']);
?>
<?php
$form->field($model, 'telefone')->hiddenInput()->widget(\yii\widgets\MaskedInput::className(), ['mask' => '(99)99999-999[9]']);
?>
<?php
$form->field($model, 'telefoneAlt')->hiddenInput()->widget(\yii\widgets\MaskedInput::className(), ['mask' => '(99)99999-999[9]']);
示例2:
<h3>Форма обратной связи</h3>
<?php
$form = ActiveForm::begin(['id' => 'form', 'errorCssClass' => '', 'fieldConfig' => ['template' => "{input}\n{error}", 'options' => ['tag' => 'label'], 'errorOptions' => ['class' => 'error-message']]]);
?>
<?php
echo $form->field($model, 'name')->textInput(['placeholder' => 'ФИО*:']);
?>
<?php
echo $form->field($model, 'email')->input('email', ['placeholder' => 'Email*:']);
?>
<?php
echo $form->field($model, 'phone')->widget(\yii\widgets\MaskedInput::className(), ['mask' => '+7-999-999-99-99', 'options' => ['placeholder' => 'phone*:']]);
?>
<?php
echo $form->field($model, 'body', ['options' => ['class' => "message"]])->textarea(['placeholder' => 'Текст сообщения*:']);
?>
<div>
<div class="clear"></div>
<div class="btns">
<?php
echo Html::submitInput('Отправить', ['class' => 'btn']);
?>
<span>* - Необходимо заполнить поля</span>
示例3:
?>
<?php
echo $form->field($model, 'contact_first_name', ['options' => ['class' => 'col-xs-6']])->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'contact_last_name', ['options' => ['class' => 'col-xs-6']])->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'email', ['options' => ['class' => 'col-xs-6']])->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'phone', ['options' => ['class' => 'col-xs-6']])->widget(MaskedInput::className(), ['mask' => '999-999-9999']);
?>
<?php
echo $form->field($model, 'address_street', ['options' => ['class' => 'col-xs-6']])->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'address_city', ['options' => ['class' => 'col-xs-6']])->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'address_state', ['options' => ['class' => 'col-xs-6 padding-right0']])->label('State')->widget(Select2::classname(), ['data' => ArrayHelper::map(State::find()->all(), 'abbreviation', 'abbreviation'), 'options' => ['placeholder' => 'Select a state ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
<?php
示例4:
?>
<?php
echo $form->field($model, 'author_id')->dropDownList(ArrayHelper::map($authors, 'author_id', 'name'), ['prompt' => 'Select...']);
?>
<?php
echo $form->field($model, 'name');
?>
<br/>
<?php
echo $form->field($model, 'date_from')->widget(MaskedInput::className(), ['mask' => '99-99-9999']);
?>
<?php
echo $form->field($model, 'date_to')->widget(MaskedInput::className(), ['mask' => '99-99-9999']);
?>
<br/>
<div class="form-group">
<?php
echo Html::submitButton('Искать', ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('Сброс', \yii\helpers\Url::toRoute('index'), ['class' => 'btn btn-default']);
?>
</div>
<?php
ActiveForm::end();
?>
示例5:
?>
</div>
<div class="col-md-6"><?php
echo $form->field($model, 'lname')->textInput();
?>
</div>
</div>
<div class="row">
<div class="col-sm-7"><?php
echo $form->field($model, 'email')->textInput();
?>
</div> <!--col-->
<div class="col-sm-5">
<?php
echo $form->field($model, 'phone')->widget(\yii\widgets\MaskedInput::className(), ['mask' => '999-999-9999']);
?>
</div> <!--col-->
</div> <!--row-->
<div class="form-group">
<?php
echo $form->field($model, 'password')->passwordInput();
?>
</div>
<div class="form-group">
<?php
echo $form->field($model, 'password_repeat')->passwordInput();
?>
</div>
示例6: JsExpression
echo $form->field($model, 'sn')->widget(\kartik\widgets\Select2::classname(), ['initValueText' => $model->sn, 'pluginOptions' => ['allowClear' => true, 'minimumInputLength' => 1, 'ajax' => ['url' => \yii\helpers\Url::to(['/admin/brand/get-brand']), 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {q:params.term}; }')], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), 'templateResult' => new JsExpression('formatRepo'), 'templateSelection' => new JsExpression('function (brand) {return brand.id;}')]]);
?>
<?php
echo $form->field($model, 'cn_name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'en_name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'py_name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'initial')->widget(\yii\widgets\MaskedInput::className(), ['mask' => 'A']);
?>
<?php
echo $form->field($model, 'show_type_name')->widget(SwitchInput::classname(), ['type' => SwitchInput::RADIO, 'items' => $model->showTypeNameItems]);
?>
<?php
echo $form->field($model, 'logo')->widget(CoreFileInput::classname(), []);
?>
<?php
echo $form->field($model, 'is_show')->widget(SwitchInput::classname(), ['pluginOptions' => ['onText' => '是', 'offText' => '否']]);
?>
</div>
<div class="box-footer">
<?php
示例7: date
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\datetime\DateTimePicker;
/* @var $this yii\web\View */
/* @var $model app\models\History */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="history-form">
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'number')->widget(\yii\widgets\MaskedInput::className(), ['mask' => '9999 9999 9999 9999'])->textInput(['placeholder' => '9999 9999 9999 9999', 'value' => $number, 'readonly' => '']);
?>
<?php
echo $form->field($model, 'use_date')->widget(DateTimePicker::classname(), ['options' => ['placeholder' => 'Choose date and time'], 'convertFormat' => true, 'pluginOptions' => ['format' => 'yyyy-MM-dd HH:i', 'startDate' => date('yyyy-MM-dd HH:i'), 'todayHighlight' => true]]);
?>
<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();
?>
示例8:
<?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('Секция');
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Создать' : 'Обновить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
示例9:
<?php
echo $form->field($model, 'detalheLocal')->textInput(['maxlength' => true, 'style' => 'width:300px']);
?>
<?php
echo $form->field($model, 'data')->widget(DatePicker::className(), ['inline' => false, 'language' => 'pt', 'clientOptions' => ['autoclose' => true, 'format' => 'dd/mm/yyyy', 'todayHighlight' => true, 'todayBtn' => true]]);
?>
<?php
echo $form->field($model, 'dataConclusao')->widget(DatePicker::className(), ['inline' => false, 'language' => 'pt', 'clientOptions' => ['autoclose' => true, 'format' => 'dd/mm/yyyy', 'todayHighlight' => true, 'todayBtn' => true]]);
?>
<?php
echo $form->field($model, 'hora')->textInput(['style' => 'width:180px'])->widget(MaskedInput::className(), ['mask' => '99:99']);
?>
<?php
echo $form->field($model, 'descricao')->textarea(['rows' => 6]);
?>
<?php
echo $form->field($model, 'procedimento')->textarea(['rows' => 6]);
?>
<?php
echo $form->field($model, 'imageFiles[]')->fileInput(['multiple' => true, 'accept' => 'image/*']);
?>
示例10:
?>
<section class="content-wrap">
<div class="container">
<div class="row pt50">
<main class="col-md-9 main-content">
<?php
$form = ActiveForm::begin();
?>
<div class="draw-main">
<div class="draw-column frame mb20 clearfix">
<div class="col-xs-2 padding-left0">
<i class="ico-01 ico-money"></i>
</div>
<?php
echo $form->field($model, 'amount', ['options' => ['class' => 'col-xs-10 pt40 padding-left0'], 'template' => '<div class="input-group"> <div class="input-group-addon color-f3">$</div> {input} </div>{hint}{error}'])->widget(MaskedInput::className(), ['clientOptions' => ['alias' => 'decimal', 'groupSeparator' => ',', 'digits' => '0', 'max' => '2000000000', 'autoGroup' => true]]);
?>
<div class="col-xs-2 padding-left0"></div>
<div class="col-xs-10 padding-left0">
<a href="<?php
echo Url::to(['/loan/index']);
?>
" type="button" class="btn btn-default form-padding-but mr10">Cancel</a>
<?php
if (count($request) == 0) {
?>
<?php
echo Html::submitButton('SEND REQUEST', ['class' => 'btn btn-primary form-padding-but btn-loading']);
?>
<?php
示例11: jQuery
$.pjax({
type: "POST",
url: "update-phone.html",
data: jQuery("#form").serialize(),
container: "#w0",
push: false
})']);
?>
</div>
<div class="col-md-6">
<?php
if ($model->country_id) {
if (!isset($phoneMask)) {
$phoneMask = $model->getPhoneMask();
}
echo $form->field($model, 'phone')->widget(MaskedInput::className(), ['name' => 'phone', 'mask' => $phoneMask[0], 'options' => ['placeholder' => $phoneMask[1], 'class' => 'form-control']]);
?>
<?php
} else {
?>
<?php
echo $form->field($model, 'phone')->textInput(['class' => 'form-control disabled', 'disabled' => true]);
?>
<?php
}
?>
</div>
</div>
<div class="row">
<div class="col-md-6 offset6">
<?php
示例12: maskedInput
/**
* Outputs masked input
* @param string $mask
* @param array $options
* @return static the field object itself
*/
public function maskedInput($mask = '', $options = [])
{
return $this->widget(MaskedInput::className(), array_merge(['mask' => $mask], $options));
}
示例13:
echo $form->field($searchModel, 'razonSocialAdquiriente');
?>
</div>
<div class="col-md-2 control-group">
<label class="control-label" for="input">Estado Doc</label>
<div class="controls">
</div>
</div>
<div class="col-md-2 control-group">
<?php
echo $form->field($searchModel, 'fechaEmisiondesde')->widget(\yii\widgets\MaskedInput::className(), ['mask' => '99/99/9999']);
?>
</div>
<div class="col-md-2 control-group">
<?php
echo $form->field($searchModel, 'fechaEmisionhasta')->widget(\yii\widgets\MaskedInput::className(), ['mask' => '99/99/9999']);
?>
</div>
</div>
<div class="row" id="crud-datatable-filters">
<div class="col-md-2 control-group">
<?php
echo $form->field($searchModel, 'tipoMoneda')->dropDownList($listaTipoMoneda, ['prompt' => 'Todos']);
?>
</div>
<div class="col-md-3 control-group">
</div>
<div class="col-md-2 control-group">
<?php
echo $form->field($searchModel, 'bl_estadoRegistro')->dropDownList($listaEstadoSunat, ['prompt' => 'Todos']);
?>
示例14: isset
<div style="font-size: 12px;">
<?php
echo \yii\widgets\Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], 'encodeLabels' => false]);
?>
</div>
<h1 class="title"><?php
echo Html::encode($this->title);
?>
</h1>
<p style="font-size: 14px;">Пожалуйста заполнителе поле номер телефона. Новый пароль будет выслан вам на
номер мобильного
телефона.</p>
<?php
echo $form->field($model, 'phone')->widget(\yii\widgets\MaskedInput::className(), ['mask' => '+7(999)-999-9999', 'model' => $model, 'attribute' => 'phone', 'options' => ['placeholder' => '+7(___)-___-____', 'class' => 'input-type-text-medium', 'style' => 'width:400px; font-size:14px;']]);
?>
<div class="form-group">
<?php
echo Html::submitButton('Выслать новый пароль', ['class' => 'btn btn-primary']);
?>
</div>
</div>
<?php
ActiveForm::end();
?>
</div>
</div>
</div>
</div>
示例15: date
?>
<?php
echo $form->field($model, 'company_name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'position')->textInput();
?>
<?php
echo $form->field($model, 'start_date')->widget(\yii\widgets\MaskedInput::className(), ['mask' => '99-99-9999', 'type' => 'date', 'options' => ['value' => date('d-m-Y', strtotime($model->start_date)), 'class' => 'form-control']]);
?>
<?php
echo $form->field($model, 'end_date')->widget(\yii\widgets\MaskedInput::className(), ['mask' => '99-99-9999', 'type' => 'date', 'options' => ['value' => date('d-m-Y', strtotime($model->end_date)), 'class' => 'form-control']]);
?>
<?php
echo $form->field($model, 'description')->textarea(['rows' => 6]);
?>
<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();
?>