本文整理汇总了PHP中CHtml::passwordField方法的典型用法代码示例。如果您正苦于以下问题:PHP CHtml::passwordField方法的具体用法?PHP CHtml::passwordField怎么用?PHP CHtml::passwordField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHtml
的用法示例。
在下文中一共展示了CHtml::passwordField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formInput
public function formInput(&$controller, $tagOptions=array())
{
ob_start();
$inputName = $this->formInputName();
$inputID = "i_{$inputName}";
echo CHtml::label($this->label, $inputID);
echo CHtml::tag('br');
if($this->isReadonly)
$tagOptions['disabled'] = true;
$tagOptions['id'] = $inputID;
if($this->value)
{
$tagOptions['value'] = 1;
?>
<div>
<?php echo Yii::t('AutoAdmin.form', '<span class="warning">Replace</span> password')?> (<?php echo Yii::t('AutoAdmin.form', 'set checkbox on for confirm')?>):
<br/><label><?php echo CHtml::checkBox("{$inputName}[is_new]", null, $tagOptions)?> <?php echo Yii::t('AutoAdmin.common', 'Yes')?></label>
</div>
<?php
echo CHtml::passwordField("{$inputName}[val]", '******', array('disabled'=>true));
}
else
{
if(!empty($this->options['pattern']))
$tagOptions['pattern'] = $this->options['pattern'];
if(isset($this->options['maxlength']))
$tagOptions['maxlength'] = $this->options['maxlength'];
echo CHtml::passwordField("{$inputName}[val]", $this->value, $tagOptions);
}
return ob_get_clean();
}
示例2: newLoginForm
public function newLoginForm()
{
$sUserName = '';
$sPassword = '';
if (Yii::app()->getConfig("demoMode") === true && Yii::app()->getConfig("demoModePrefill") === true) {
$sUserName = Yii::app()->getConfig("defaultuser");
$sPassword = Yii::app()->getConfig("defaultpass");
}
$this->getEvent()->getContent($this)->addContent(CHtml::tag('li', array(), "<label for='user'>" . gT("Username") . "</label>" . CHtml::textField('user', $sUserName, array('size' => 40, 'maxlength' => 40))))->addContent(CHtml::tag('li', array(), "<label for='password'>" . gT("Password") . "</label>" . CHtml::passwordField('password', $sPassword, array('size' => 40, 'maxlength' => 40))));
}
示例3: passwordField
/**
* Generates a password field input.
* @param string the input name
* @param string the input value
* @param array additional HTML attributes. Besides normal HTML attributes, a few special
* attributes are also recognized (see {@link clientChange} and {@link tag} for more details.)
* @return string the generated input field
* @see clientChange
* @see inputField
*/
public static function passwordField($name, $value = '', $htmlOptions = array())
{
if (isset($htmlOptions['class'])) {
if (stripos($htmlOptions['class'], 'ui-corner-all') === false) {
$htmlOptions['class'] .= ' ui-corner-all';
}
} else {
$htmlOptions['class'] = 'ui-corner-all';
}
return parent::passwordField($name, $value, $htmlOptions);
}
示例4: run
/**
* Run this widget.
* This method registers necessary CSS and JS files and renders the needed JS and HTML code.
*/
public function run()
{
list($name, $id) = $this->resolveNameID();
if (isset($this->htmlOptions['id'])) {
$id = $this->htmlOptions['id'];
} else {
$this->htmlOptions['id'] = $id;
}
if (isset($this->htmlOptions['name'])) {
$name = $this->htmlOptions['name'];
}
if ($this->hasModel()) {
echo CHtml::activePasswordField($this->model, $this->attribute, $this->htmlOptions);
} else {
echo CHtml::passwordField($name, $this->value, $this->htmlOptions);
}
$this->registerClientScript();
$this->registerClientScriptFiles();
}
示例5: run
/**
*### .run()
*
* Runs the widget.
*/
public function run()
{
list($name, $id) = $this->resolveNameID();
if ($this->hasModel()) {
if ($this->form) {
echo $this->form->passwordField($this->model, $this->attribute, $this->htmlOptions);
} else {
echo CHtml::activePasswordField($this->model, $this->attribute, $this->htmlOptions);
}
} else {
echo CHtml::passwordField($name, $this->value, $this->htmlOptions);
}
$this->registerClientScript();
$options = !empty($this->options) ? CJavaScript::encode($this->options) : '';
ob_start();
echo "jQuery('#{$id}').passField({$options})";
foreach ($this->events as $event => $handler) {
echo ".on('{$event}', " . CJavaScript::encode($handler) . ")";
}
Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $this->getId(), ob_get_clean() . ';');
}
示例6: isset
echo CHtml::textField('email_address', isset($data['email_address']) ? $data['email_address'] : "", array('class' => "uk-form-width-large", 'data-validation' => "required"));
?>
</div>
<?php
$FunctionsK = new FunctionsK();
$FunctionsK->clientRegistrationCustomFields(true, $data);
?>
<div class="uk-form-row">
<label class="uk-form-label"><?php
echo Yii::t("default", "Password");
?>
</label>
<?php
echo CHtml::passwordField('password', '', array('class' => "uk-form-width-large"));
?>
</div>
<div class="uk-form-row">
<label class="uk-form-label"><?php
echo Yii::t("default", "Street Address");
?>
</label>
<?php
echo CHtml::textField('street', isset($data['street']) ? $data['street'] : "", array('class' => "uk-form-width-large", 'data-validation' => "required"));
?>
</div>
<div class="uk-form-row">
<label class="uk-form-label"><?php
示例7: renderPassword
public function renderPassword($name, array $metaData, $form = null)
{
$out = '';
$id = $name;
$value = isset($metaData['current']) ? $metaData['current'] : '';
if (isset($metaData['label'])) {
$out .= CHtml::label($metaData['label'], $id, $metaData['labelOptions']);
}
$out .= CHtml::passwordField($id, $value, array('id' => $id, 'form' => $form));
return $out;
}
示例8: array
</div>
<div class="controls">
<?php
echo CHtml::passwordField('Member[pr_member_new_password]', '');
?>
<div class="help-inline error" id="pr_member_password_confirm_error"><?php
echo $error['confirm'] . $error['eval'];
?>
</div>
</div>
</div>
<div class="control-group ">
<div>
<?php
echo CHtml::label('Xác nhận mật khẩu <span class="required">*</span>', 'pr_member_confirm_password', array('class' => 'control-label required'));
?>
</div>
<div class="controls">
<?php
echo CHtml::passwordField('Member[pr_member_confirm_password]', '');
?>
<div class="help-inline error" id="pr_member_password_confirm_error"></div>
</div>
</div>
<div class="form-actions">
<?php
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => 'Save', 'ajaxOptions' => array('type' => 'POST')));
?>
</div>
<?php
$this->endWidget();
示例9: isset
?>
</div>
<?php
}
?>
<?php
if (!$success) {
?>
<p>
<?php
echo Yii::t('DefaultTheme', 'To change the email address associated to your account, please enter your current password.');
?>
</p>
<?php
echo CHtml::passwordField('password', isset($_POST['password']) ? $_POST['password'] : '', array('placeholder' => Yii::t('DefaultTheme', 'Your current password')));
?>
<?php
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'success', 'label' => 'Submit', 'htmlOptions' => array('id' => 'submit-comment', 'class' => 'sharebox-submit pull-right', 'style' => 'margin-top: -4px')));
?>
<?php
}
?>
</div>
<?php
$this->endWidget();
?>
</div>
</div>
</div>
示例10:
<div class="row">
<?php
echo $form->labelEx($model, 'username');
?>
<?php
echo CHtml::textField("txtUsername");
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'password');
?>
<?php
echo CHtml::passwordField("txtPassword");
?>
</div>
<?php
echo CHtml::hiddenField("login", 1);
?>
<div class="clb"></div>
<div class="row submit">
<?php
echo CHtml::submitButton('Login');
?>
</div>
<?php
$this->endWidget();
?>
示例11: array
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Mail username:</label>
<div class="col-lg-4">
<?php
echo CHtml::textField('settings[' . Constants::KEY_EMAIL_USERNAME . ']', $settings[Constants::KEY_EMAIL_USERNAME], array('class' => 'form-control'));
?>
<p class="help-block">e.g noreply@xchnge.co</p>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Mail password:</label>
<div class="col-lg-4">
<?php
echo CHtml::passwordField('settings[' . Constants::KEY_EMAIL_PASSWORD . ']', $settings[Constants::KEY_EMAIL_PASSWORD], array('class' => 'form-control'));
?>
<p class="help-block">Password for the username.</p>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Mail security:</label>
<div class="col-lg-4">
<?php
echo CHtml::dropDownList('settings[' . Constants::KEY_EMAIL_SECURITY . ']', $settings[Constants::KEY_EMAIL_SECURITY], array('' => 'NULL', 'ssl' => 'SSL', 'tls' => 'TLS'), array('class' => 'form-control'));
?>
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Mail Theme:</label>
示例12: renderInputFieldByType
private function renderInputFieldByType($form, $attribute)
{
if (array_search($attribute, $this->password) !== FALSE) {
echo CHtml::passwordField($attribute, $this->model->{$attribute}, array('size' => 45));
return;
}
if (array_search($attribute, $this->images) !== FALSE) {
echo $form->fileField($this->model, $attribute);
return;
}
if (array_search($attribute, $this->bool) !== FALSE) {
echo $form->checkBox($this->model, $attribute);
return;
}
if (isset($this->dropDownData[$attribute])) {
echo $form->dropDownList($this->model, $attribute, $this->dropDownData[$attribute]);
return;
}
if (array_search($attribute, $this->datetime) !== FALSE) {
$this->widget('core.extensions.yii-backvendor.extensions.timepicker.EJuiDateTimePicker', array('name' => $this->modelName . '[' . $attribute . ']', 'value' => $this->model->{$attribute}, 'options' => array('dateFormat' => 'yy-mm-dd', 'timeFormat' => 'hh:mm:ss'), 'language' => ''));
return;
}
echo $form->textField($this->model, $attribute, array('size' => 45));
return;
}
示例13: array
?>
<h2><?php
echo Yii::t("default", "Reset Password");
?>
</h2>
<div class="uk-form-row">
<?php
echo CHtml::passwordField('password', '', array('class' => "uk-form-width-large", 'data-validation' => "required", 'placeholder' => Yii::t("default", "New Password")));
?>
</div>
<div class="uk-form-row">
<?php
echo CHtml::passwordField('confirm_password', '', array('class' => "uk-form-width-large", 'data-validation' => "required", 'placeholder' => Yii::t("default", "Confirm Password")));
?>
</div>
<div class="uk-form-row">
<input type="submit" value="<?php
echo Yii::t("default", "Submit");
?>
" class="change-pass-btn uk-button uk-button-success uk-width-1-4">
</div>
</form>
<?php
} else {
?>
<p class="uk-text-danger"><?php
示例14: switch
</div>
<div
class="large-<?php
echo $layoutColumns['field'];
?>
column<?php
if (empty($htmlOptions['append-text']) || empty($layoutColumns['append-text'])) {
?>
end<?php
}
?>
">
<?php
switch ($htmlOptions['type']) {
case 'password':
echo CHtml::passwordField($name, $value, $htmlOptions);
break;
case 'number':
echo CHtml::numberField($name, $value, $htmlOptions);
break;
case 'time':
echo CHtml::timeField($name, $value, $htmlOptions);
break;
case 'text':
default:
echo CHtml::textField($name, $value, $htmlOptions);
}
if (!empty($links)) {
foreach ($links as $link) {
echo '<span class="field-info">' . CHtml::link($link['title'], $link['href'], array('id' => $link['id'])) . '</span>';
}
示例15: array
if (Yii::app()->user->id == $model->id || Yii::app()->user->checkAccess('admin')) {
?>
<div class="form-group">
<label class="col-sm-2 control-label">Mật khẩu mới</label>
<div class="col-sm-4">
<?php
echo CHtml::passwordField('new_pass', '', array('class' => 'form-control', 'placeholder' => 'Cập nhật lại mật khẩu nếu cần thay đổi'));
?>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Mật khẩu xác nhận</label>
<div class="col-sm-4">
<?php
echo CHtml::passwordField('confirm_pass', '', array('class' => 'form-control', 'placeholder' => 'Xác nhận mật khẩu'));
?>
</div>
</div>
<div class="form-group">
<?php
echo $form->labelEx($model, 'hvt', array('class' => 'col-sm-2 control-label'));
?>
<div class="col-sm-2">
<?php
echo $form->telField($model, 'lastname', array('class' => 'form-control', 'size' => 20, 'maxlength' => 20, 'placeholder' => 'Họ của bạn...'));
?>
<?php
echo $form->error($model, 'lastname');
?>