本文整理汇总了PHP中yii\bootstrap\Html::activePasswordInput方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::activePasswordInput方法的具体用法?PHP Html::activePasswordInput怎么用?PHP Html::activePasswordInput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\bootstrap\Html
的用法示例。
在下文中一共展示了Html::activePasswordInput方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
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>
</div>
<?php
ActiveForm::end();
?>
<div class="col-lg-2 col-xs-6" >
示例2:
<?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');
?>
</a>
</div>
<?php
ActiveForm::end();
?>
</div>