當前位置: 首頁>>代碼示例>>PHP>>正文


PHP widgets\MaskedInput類代碼示例

本文整理匯總了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>
開發者ID:alexanderkuz,項目名稱:stoi,代碼行數:31,代碼來源:contact.php

示例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]']);
開發者ID:FernandoMauricio,項目名稱:processos_seletivos,代碼行數:30,代碼來源:_form-candidato.php

示例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]);
 }
開發者ID:bloody-hell,項目名稱:yii2-xdan-datetimepicker,代碼行數:10,代碼來源:DateTimePicker.php

示例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">
開發者ID:HejVkt,項目名稱:auto.only3.ru,代碼行數:31,代碼來源:_form.php

示例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();
?>






開發者ID:sergey-exu,項目名稱:namagistralnoi,代碼行數:23,代碼來源:getprice.php

示例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 
開發者ID:oyoy8629,項目名稱:yii-core,代碼行數:31,代碼來源:_form.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();
?>
開發者ID:skamnev,項目名稱:members,代碼行數:31,代碼來源:_form.php

示例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();
開發者ID:baranov-nt,項目名稱:some-2,代碼行數:31,代碼來源:reg.php

示例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 
開發者ID:ailingsen,項目名稱:betterdebt,代碼行數:31,代碼來源:financial_info.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 
    }
    ?>
開發者ID:dbsparkle-team,項目名稱:unispot,代碼行數:29,代碼來源:index.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;
              }
開發者ID:hscstudio,項目名稱:psaham,代碼行數:31,代碼來源:_form.php

示例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();
?>
開發者ID:Godscreature,項目名稱:Books,代碼行數:31,代碼來源:_search.php

示例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>
開發者ID:aekkapun,項目名稱:dlt-tcplch,代碼行數:31,代碼來源:_form.php

示例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"
開發者ID:ibergonzi,項目名稱:country,代碼行數:31,代碼來源:index.php

示例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();
?>
開發者ID:eR1an9,項目名稱:phpindonesia.or.id-membership,代碼行數:31,代碼來源:_form.php


注:本文中的yii\widgets\MaskedInput類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。