本文整理汇总了PHP中yii\bootstrap\Html::activeTextInput方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::activeTextInput方法的具体用法?PHP Html::activeTextInput怎么用?PHP Html::activeTextInput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\bootstrap\Html
的用法示例。
在下文中一共展示了Html::activeTextInput方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
echo Html::beginTag('div', ['class' => 'input-group']);
if (!isset($this->options['class'])) {
$this->options['class'] = 'form-control';
}
$iconId = 'icon-' . $this->options['id'];
if (!isset($this->options['aria-describedby'])) {
$this->options['aria-describedby'] = $iconId;
}
if ($this->hasModel()) {
$replace['{input}'] = Html::activeTextInput($this->model, $this->attribute, $this->options);
} else {
$replace['{input}'] = Html::textInput($this->name, $this->value, $this->options);
}
if ($this->icon != '') {
$replace['{icon}'] = Html::tag('span', Icon::show($this->icon, [], Icon::FA), ['class' => 'input-group-addon', 'id' => $iconId]);
}
echo strtr($this->template, $replace);
echo Html::endTag('div');
$view = $this->getView();
Assets::register($view);
$idMaster = $this->hasModel() ? Html::getInputId($this->model, $this->fromField) : $this->fromField;
$idSlave = $this->options['id'];
$view->registerJs("\n \$('#{$idMaster}').syncTranslit({\n destination: '{$idSlave}',\n type: 'url',\n caseStyle: 'lower',\n urlSeparator: '-'\n });");
}
示例2:
?>
</div>
<?php
echo Html::activeDropDownList($model, 'expiration_month', $months, ['class' => 'form-control', 'style' => 'width:60%;display:inline-block;padding-left:6px;']);
?>
<?php
echo Html::activeDropDownList($model, 'expiration_year', $years, ['class' => 'form-control', 'style' => 'width:38%;display:inline-block;padding-left:6px;']);
?>
</div>
<div class="col-sm-3">
<div style="margin-bottom: 4px;"><?php
echo Yii::t('app', 'Security Code');
?>
</div>
<?php
echo Html::activeTextInput($model, 'security_code', ['class' => 'form-control']);
?>
</div>
</div>
<div class="row" style="margin-top: 10px;">
<div class="col-xs-12">
<button type="button" id="btn-add-payment-save" class="btn btn-primary"><span class="glyphicon glyphicon-ok"></span> <?php
echo Yii::t('app', 'Save Credit Card');
?>
</button>
<?php
if (!empty($payments)) {
?>
<button type="button" id="btn-add-payment-cancel" class="btn btn-defaul"><?php
示例3:
<div class="col-sm-4">
<div style="margin-bottom: 4px;"><?php
echo Yii::t('app', 'Email Address');
?>
</div>
<?php
echo Html::activeTextInput($model, 'shipping_email', ['class' => 'form-control']);
?>
</div>
<div class="col-sm-4">
<div style="margin-bottom: 4px;"><?php
echo Yii::t('app', 'Phone Number');
?>
</div>
<?php
echo Html::activeTextInput($model, 'shipping_phone', ['class' => 'form-control']);
?>
</div>
</div>
<div class="row" style="margin-top: 10px;">
<div class="col-xs-12">
<?php
if (!empty($model->id)) {
?>
<a href="<?php
echo Url::to(['shopcart/destination-delete', 'id' => $model->id]);
?>
" id="btn-destination-delete" class="btn btn-default" style="float: right" ><span class="glyphicon glyphicon-remove"></span> <?php
echo Yii::t('app', 'Delete');
示例4:
use yii\bootstrap\Html;
$model = new \app\models\LoginForm();
?>
<div class="container">
<div class="row">
<div class="col-lg-2 hidden-md hidden-sm hidden-xs" style="text-align: right;line-height: 46px;"><span class="ya-registrado"><?php
echo Yii::t('app', 'Registered?');
?>
</span></div>
<?php
$form = ActiveForm::begin(['action' => \yii\helpers\Url::to(['site/login']), 'method' => 'post', 'id' => 'formLogin']);
?>
<div class="col-lg-3 has-field">
<div style="height: 8px;"></div>
<?php
echo Html::activeTextInput($model, 'username', ['class' => 'input-username form-control input-sm', 'placeholder' => Yii::t('app', 'Email address')]);
?>
</div>
<div class="col-lg-2 has-field">
<div style="height: 8px;"></div>
<?php
echo Html::activePasswordInput($model, 'password', ['class' => 'input-password form-control input-sm', 'placeholder' => Yii::t('app', 'Password')]);
?>
</div>
<div class="col-lg-1 has-field">
<div style="height: 8px;"></div>
<input type="submit" value="<?php
echo Yii::t('app', 'Submit');
?>
" class="btn btn-primary btn-sm input-sm form-control">
<div style="height: 8px;"></div>
示例5:
<div class="input-group extra">
<?php
echo $form->field($model, 'places')->listBox($model->placesTypes, ['class' => 'chosen', 'multiple' => true]);
?>
<?php
echo Html::activeTextInput($model, 'otherPlaces', ['placeholder' => 'Другой вариант (указать)', 'class' => 'form-control']);
?>
</div>
<div class="input-group">
<a class="clear-btn" href="#">Сбросить</a>
</div>
</div>
<div class="col-sm-3 custom">
<div class="input-group">
<label>контактная информация</label>
<?php
echo Html::activeTextInput($model, 'name', ['placeholder' => 'имя', 'class' => 'form-control']);
?>
<?php
echo Html::activeTextInput($model, 'phone', ['placeholder' => 'телефон', 'class' => 'form-control']);
?>
<?php
echo Html::activeTextInput($model, 'email', ['placeholder' => 'e-mail', 'class' => 'form-control']);
?>
<input type="submit" class="y-btn" value="отправить заказ"/>
</div>
</div>
</div>
</div>
</form>
</section>
示例6:
<hr>
<br>
<div class="row">
<div class="col-md-8"> <?php
echo $form->field($model, 'name')->textInput(['id' => 'space-name', 'placeholder' => Yii::t('SpaceModule.views_create_create', 'space name'), 'maxlength' => 45]);
?>
</div>
<div class="col-md-4"> <strong><?php
echo Yii::t('SpaceModule.views_create_create', 'Color');
?>
</strong>
<div class="input-group space-color-chooser" style="margin-top: 5px;">
<?php
echo Html::activeTextInput($model, 'color', ['class' => 'form-control', 'id' => 'space-color-picker', 'value' => '#000000']);
?>
<span class="input-group-addon"><i></i></span>
</div>
<br></div>
</div>
<?php
echo $form->field($model, 'description')->textarea(['placeholder' => Yii::t('SpaceModule.views_create_create', 'space description'), 'rows' => '3']);
?>
<a data-toggle="collapse" id="access-settings-link" href="#collapse-access-settings"
style="font-size: 11px;"><i
class="fa fa-caret-right"></i> <?php
echo Yii::t('SpaceModule.views_create_create', 'Advanced access settings');
?>
示例7:
echo Yii::t('app', 'Welcome');
?>
</h2>
<p><?php
echo Yii::t('app', 'Enter your credentials to access your orders.');
?>
</p>
<?php
echo !empty($loginError) ? Html::tag('div', $loginError, ['class' => 'alert alert-danger']) : '';
?>
<label for="inputEmail" class="sr-only"><?php
echo Yii::t('app', 'Email address');
?>
</label>
<?php
echo Html::activeTextInput($model, 'username', ['id' => 'inputEmail', 'class' => 'form-control', 'placeholder' => Yii::t('app', 'Email address'), 'required' => '', 'autofocus' => '']);
?>
<label for="inputPassword" class="sr-only"><?php
echo Yii::t('app', 'Password');
?>
</label>
<?php
echo Html::activePasswordInput($model, 'password', ['id' => 'inputPassword', 'class' => 'form-control', 'placeholder' => Yii::t('app', 'Password'), 'required' => '']);
?>
<button class="btn btn-lg btn-primary btn-block" type="submit"><?php
echo Yii::t('app', 'Sign In');
?>
</button>
<div style="margin: 10px;">
<a href="#" onclick="$('#form-password').show();$('#form-login').hide();return false"><?php
echo Yii::t('app', 'Forgot My Password');
示例8: reset
<?php
echo Yii::t('hipanel:domain', 'IP addresses can be assigned to child name servers only.');
?>
<?php
echo Yii::t('hipanel:domain', 'Child name servers are created or changed automatically according to specified data.');
?>
</p>
</div>
<div class="row" style="margin-top: 15pt;">
<div class="col-md-10 inline-form-selector">
<?php
if (!is_array($model)) {
?>
<?php
echo Html::activeTextInput($model, 'nsips', ['class' => 'form-control', 'placeholder' => $model->getAttributeLabel('nameservers'), 'autocomplete' => 'off']);
?>
<?php
} else {
?>
<?php
echo Html::textInput('nsips', '', ['class' => 'form-control', 'placeholder' => reset($model)->getAttributeLabel('nameservers'), 'autocomplete' => 'off']);
?>
<?php
}
?>
</div>
<div class="col-md-2 text-right">
<?php
echo Html::submitButton(Yii::t('hipanel', 'Save'), ['class' => 'btn btn-success', 'id' => 'nss-save-button', 'data-loading-text' => '<i class="fa fa-circle-o-notch fa-spin"></i> ' . Yii::t('hipanel', 'saving')]);
?>