本文整理汇总了PHP中yii\widgets\MaskedInput类的典型用法代码示例。如果您正苦于以下问题:PHP MaskedInput类的具体用法?PHP MaskedInput怎么用?PHP MaskedInput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MaskedInput类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<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>
示例2: 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]']);
示例3: renderInput
protected function renderInput()
{
if (!$this->maskEnabled) {
if ($this->hasModel()) {
return Html::activeTextInput($this->model, $this->attribute, $this->options);
}
return Html::textInput($this->name, $this->value, $this->options);
}
return MaskedInput::widget(['mask' => $this->mask ?: $this->generateMask(), 'model' => $this->hasModel() ? $this->model : null, 'attribute' => $this->hasModel() ? $this->attribute : null, 'value' => $this->hasModel() ? null : $this->value, 'options' => $this->options, 'clientOptions' => $this->maskOptions]);
}
示例4:
</div>
<div style="clear:both;"></div>
</div>
<div class="row tech-char">
<div class="ab_reg">
Технические характеристики
</div>
<?php
echo $form->field($model, 'year')->widget(MaskedInput::classname(), ['mask' => '9{1,4}', 'clientOptions' => ['greedy' => true, 'alias' => 'year']])->textInput(['maxlength' => true, 'class' => 'inptxt auto-width']);
?>
<?php
echo $form->field($model, 'power')->widget(MaskedInput::classname(), ['mask' => '9{1,3}', 'clientOptions' => ['greedy' => true, 'alias' => 'power']])->textInput(['maxlength' => true, 'class' => 'inptxt auto-width']);
?>
<?php
echo $form->field($model, 'trans')->radioList($model->getTransList(), ['default' => '1']);
?>
</div>
<div class="row tech-char">
<?php
echo $form->field($model, 'conditioner')->radioList(['0' => 'Отсутствует', '1' => 'Есть']);
?>
</div>
<div class="row tech-char">
示例5:
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
?>
<?php
$form = ActiveForm::begin(['options' => ['id' => 'getprice-form']]);
echo $form->field($model, 'name', ['template' => '{input}', 'inputOptions' => ['placeholder' => 'Имя', 'class' => 'form-control']]);
?>
<?php
echo $form->field($model, 'phone')->label(false)->error(false)->widget(\yii\widgets\MaskedInput::className(), ['mask' => '+7 (999) 999 99 99'])->textInput(['placeholder' => 'Телефон']);
?>
<div style="padding:0 10px;">
<?php
echo Html::submitButton('ОТПРАВИТЬ ЗАПРОС', ['class' => 'btn btn-lg btn-danger btn-block', 'style' => 'font-size:14px;']);
?>
</div>
<?php
ActiveForm::end();
?>
示例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
?>
<?php
if (!empty($model->publish_date)) {
$model->publish_date = date('d.m.Y', strtotime($model->publish_date));
}
?>
<?php
//datapicker language issue;
$language = Yii::$app->language;
if ($language == 'en') {
$language = 'en-GB';
}
?>
<?php
echo $form->field($model, 'publish_date')->widget(\yii\widgets\MaskedInput::className(), ['clientOptions' => ['alias' => 'dd.mm.yyyy']])->widget(DatePicker::className(), ['template' => '{addon}{input}', 'clientOptions' => ['autoclose' => true, 'format' => 'dd.mm.yyyy', 'minView' => 1], 'language' => $language]);
?>
<?php
echo $form->field($model, 'is_active')->checkbox(['label' => Yii::t('backend', 'Active')]);
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
示例8:
use yii\widgets\ActiveForm;
use yii\widgets\MaskedInput;
/* @var $this yii\web\View */
/* @var $model common\models\Profile */
/* @var $modelUser common\models\User */
/* @var $form ActiveForm */
?>
<div class="main-reg">
<?php
$form = ActiveForm::begin();
?>
<div class="row">
<div class="col-md-4 col-md-offset-4">
<?php
echo $form->field($model, 'phone')->widget(MaskedInput::className(), ['name' => 'phone', 'mask' => '7 (999) 999-9999', 'options' => ['placeholder' => '7 (___) ___-____', 'class' => 'form-control']]);
?>
<?php
if ($model->scenario === 'emailActivation' || $model->scenario === 'phoneAndEmailFinish' || Yii::$app->controller->action->id == 'reg') {
?>
<?php
echo $form->field($model, 'email');
?>
<?php
}
?>
<?php
if (Yii::$app->controller->action->id == 'reg') {
?>
<?php
echo $form->field($model, 'password')->passwordInput();
示例9: function
}]);
?>
</div>
<div class="form-ul pb20 clearfix">
<?php
echo $form->field($appModel, 'net_worth')->label('Please provide an estimate of your net worth:')->radioList(DictApplicant::$netWorth, ['item' => function ($index, $label, $name, $checked, $value) {
$radio = Html::radio($name, $checked, ['class' => 'just-app', 'value' => $value]);
$label = Html::label($radio . $label);
return Html::tag('div', $label, ['class' => 'radio col-xs-4']);
}]);
?>
</div>
<div class="form-ul pb20 border-bottom clearfix">
<?php
echo $form->field($appModel, 'total_value_with_advisor', ['options' => ['class' => 'col-xs-12 padding-left0'], 'template' => '{label}<div class="input-group"> <div class="input-group-addon">$</div> {input} <div class="input-group-addon">.00</div> </div>{hint}{error}', 'inputOptions' => ['class' => 'form-control just-app']])->label('What is the value of all your accounts with your investment advisor?')->widget(MaskedInput::className(), ['clientOptions' => ['alias' => 'decimal', 'groupSeparator' => ',', 'digits' => '0', 'max' => '2000000000', 'autoGroup' => true]]);
?>
</div>
<h4 style="font-weight:bold;">INSTRUCTIONS TO RECEIVE LINE OF CREDIT DISBURSEMENTS</h4>
<p class="wwbw">Designate the checking or savings account into which you want your Line of Credit disbursements to be deposited. Disbursements will be made by ACH. You may change your designated deposit account at any time on the BriteLine Portal. Any change to your designated deposit account for disbursements will take effect within two (2) business days.</p>
<img width="456" height="231" src="<?php
echo Url::to('@web/images/loan_disbursment.jpg');
?>
" />
<br /><br />
<div class="form-ul clearfix">
<?php
echo $form->field($appFormModel, 'bank_name', ['options' => ['class' => 'col-xs-6 padding-left0'], 'inputOptions' => ['class' => 'form-control just-app-input']]);
?>
<?php
示例10:
<?php
echo $widget->form->field($widget->model, $widget->attribute, ['addon' => ['prepend' => ['content' => $buttonDropdown, 'asButton' => true]]])->widget(MaskedInput::className(), $widgetConfig)->label(false);
?>
<?php
} else {
?>
<div class="input-group" >
<span class="input-group-btn"><?php
echo $buttonDropdown;
?>
</span>
<?php
echo MaskedInput::widget($widgetConfig);
?>
</div>
<?php
if ($widget->hint) {
?>
<?php
echo Html::activeHint($widget->model, $widget->attribute, ['hint' => $widget->hint]);
?>
<?php
}
?>
示例11:
<?php
echo $form->field($model, 'KOM_BELI')->widget(MaskedInput::classname(), ['clientOptions' => ['alias' => 'numeric', 'groupSeparator' => ',', 'radixPoint' => '.', 'autoGroup' => true, 'removeMaskOnSubmit' => true]]);
?>
</div>
</div>
<div class="row">
<div class="col-md-3">
<?php
echo $form->field($model, 'KOM_JUAL')->widget(MaskedInput::classname(), ['clientOptions' => ['alias' => 'numeric', 'groupSeparator' => ',', 'radixPoint' => '.', 'autoGroup' => true, 'removeMaskOnSubmit' => true]]);
?>
</div>
</div>
<div class="row">
<div class="col-md-3">
<?php
echo $form->field($model2, 'JML_LBRSAHAM')->widget(MaskedInput::classname(), ['clientOptions' => ['alias' => 'numeric', 'groupSeparator' => ',', 'radixPoint' => '.', 'autoGroup' => true, 'removeMaskOnSubmit' => true]])->label('Jml Saham / Lot');
?>
</div>
</div>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary', 'data-confirm' => "Apakah anda yakin akan menyimpan data ini?"]);
?>
<?php
echo Html::a('Close', ['site/index'], ['class' => 'btn btn-default', 'onclick' => '
if (confirm("Apakah yakin mau keluar dari halaman ini?")) {
return true;
}
else{
return false;
}
示例12:
?>
<?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();
?>
示例13:
</div>
<div class="col-md-3 col-xs-3">
<span>จังหวัด</span><?php
echo $form->field($model, 'province')->textInput(['placeholder' => 'จังหวัด'])->label(false);
?>
</div>
<div class="col-md-3 col-xs-3">
<span>ประเทศ</span><?php
echo $form->field($model, 'country')->textInput(['placeholder' => 'ประเทศ'])->label(false);
?>
</div>
</div>
<div class="row">
<div class="col-md-4 col-xs-4">
<span>โทรศัพท์</span><?php
echo $form->field($model, 'telephone')->widget(\yii\widgets\MaskedInput::classname(), ['mask' => '99-9999-9999'])->label(false);
?>
</div>
<div class="col-md-4 col-xs-4"><span>มีความประสงค์ขออนุญาตนำรถที่จดทะเบียนในประเทศ</span>
<?php
echo $form->field($model, 'car_enroll_country')->textInput(['maxlength' => true])->label(false);
?>
</div>
<div class="col-md-4 col-xs-4"><span>หมายเลขทะเบียน</span>
<?php
echo $form->field($model, 'plates_number')->textInput(['maxlength' => true])->label(false);
?>
</div>
</div>
<div class="row">
<div class="col-xs-6"><span>เข้ามาในราชอาณาจักรเป็นการชั่วคราวเพื่อใช้ในการท่องเที่ยว ตั้งแต่วันที่ </span>
示例14: function
$url = Yii::$app->urlManager->createUrl(['mensajes/create-ajax', 'modelName' => 'frontend\\models\\Vehiculos', 'modelID' => $model->ing_id_vehiculo]);
return $url;
}
if ($action === 'view') {
$url = Yii::$app->urlManager->createUrl(['accesos/view', 'id' => $model->id_acceso]);
return $url;
}
}], ['attribute' => 'id_acceso', 'format' => 'raw', 'value' => function ($model, $index, $widget) {
return Html::a($model->id_acceso, Yii::$app->urlManager->createUrl(['accesos/view', 'id' => $model->id_acceso]), ['title' => 'Ver detalle', 'target' => '_blank', 'data-pjax' => '0']);
}], ['attribute' => 'ing_fecha', 'options' => ['style' => 'width:275px;'], 'contentOptions' => ['style' => 'width:275px;'], 'headerOptions' => ['style' => 'width:275px;'], 'format' => ['date'], 'filter' => MaskedInput::widget(['model' => $searchModel, 'attribute' => 'ing_fecha', 'mask' => '99/99/9999'])], ['attribute' => 'ing_hora', 'format' => ['time']], ['attribute' => 'id_persona', 'format' => 'raw', 'value' => function ($model, $index, $widget) {
return Html::a($model->id_persona, Yii::$app->urlManager->createUrl(['personas/view', 'id' => $model->id_persona]), ['title' => 'Ver detalle de persona', 'target' => '_blank', 'data-pjax' => '0']);
}], 'r_apellido', 'r_nombre', 'r_nombre2', 'r_nro_doc', ['attribute' => 'ing_id_vehiculo', 'format' => 'raw', 'value' => function ($model, $index, $widget) {
return Html::a($model->ing_id_vehiculo, Yii::$app->urlManager->createUrl(['vehiculos/view', 'id' => $model->ing_id_vehiculo]), ['title' => 'Ver detalle del vehiculo', 'target' => '_blank', 'data-pjax' => '0']);
}], 'r_ing_patente', 'r_ing_marca', 'r_ing_modelo', 'r_ing_color', 'ing_id_porton', 'r_ing_usuario', ['attribute' => 'id_concepto', 'value' => 'desc_concepto', 'filter' => AccesosConceptos::getListaConceptos(true)], 'ing_id_llave', 'motivo', ['attribute' => 'id_autorizante', 'format' => 'raw', 'value' => function ($model, $index, $widget) {
return Html::a($model->id_autorizante, Yii::$app->urlManager->createUrl(['personas/view', 'id' => $model->id_autorizante]), ['title' => 'Ver detalle de autorizante', 'target' => '_blank', 'data-pjax' => '0']);
}], 'r_aut_apellido', 'r_aut_nombre', 'r_aut_nombre2', 'id_uf', ['attribute' => 'egr_fecha', 'format' => ['date'], 'filter' => MaskedInput::widget(['model' => $searchModel, 'attribute' => 'egr_fecha', 'mask' => '99/99/9999'])], ['attribute' => 'egr_hora', 'format' => ['time']], ['attribute' => 'egr_id_vehiculo', 'format' => 'raw', 'value' => function ($model, $index, $widget) {
return Html::a($model->egr_id_vehiculo, Yii::$app->urlManager->createUrl(['vehiculos/view', 'id' => $model->egr_id_vehiculo]), ['title' => 'Ver detalle del vehiculo', 'target' => '_blank', 'data-pjax' => '0']);
}], 'r_egr_patente', 'r_egr_marca', 'r_egr_modelo', 'r_egr_color', 'egr_id_porton', 'r_egr_usuario', 'egr_id_llave', 'control', ['attribute' => 'estado', 'value' => function ($data) {
return Accesos::getEstados($data->estado);
}, 'filter' => Accesos::getEstados()], 'motivo_baja'];
if (\Yii::$app->user->can('exportarConsAccesos')) {
// contiene la selección inicial de columnas, es decir, todas
// por ejemplo [0,1,2,3]
$poSel = [];
// contiene las descripciones de las columnas
// por ejemplo [0=>'Portón', 1=>'Usuario',2=>'Fecha',3=>'Texto']
$poItems = [];
$i = -1;
foreach ($columns as $c) {
$i++;
// si es un array busca la clave "attribute"
示例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();
?>