activePasswordField() public static method

Generates a password field input for a model attribute.
See also: self::activeTextInputField
public static activePasswordField ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model.
$attribute string the attribute.
$htmlOptions array additional HTML attributes.
return string the generated input field.
Ejemplo n.º 1
0
	
	<div class="form-control input-lg" style="width: 45%;">
		<?php 
echo TbHtml::activeLabelEx($model, 'username');
?>
		<?php 
echo TbHtml::activeTextField($model, 'username');
?>
	</div><br/>
	
	<div class="form-control input-lg" style="width: 45%;">
		<?php 
echo TbHtml::activeLabelEx($model, 'password');
?>
		<?php 
echo TbHtml::activePasswordField($model, 'password');
?>
	</div><br/>
	
	<div style="width: 45%;">
		<p class="hint">
		<?php 
echo TbHtml::link(UserModule::t("Register"), Yii::app()->getModule('user')->registrationUrl);
?>
<br/><?php 
echo TbHtml::link(UserModule::t("Lost Password?"), Yii::app()->getModule('user')->recoveryUrl);
?>
		</p>
	</div>
	<!--
	<div class="row-fluid rememberMe">
Ejemplo n.º 2
0
 public function testActivePasswordField()
 {
     $I = $this->codeGuy;
     $html = TbHtml::activePasswordField(new Dummy(), 'password', array('class' => 'input'));
     $input = $I->createNode($html, 'input[type=password]');
     $I->seeNodeAttributes($input, array('class' => 'input', 'id' => 'Dummy_password', 'name' => 'Dummy[password]', 'value' => 'secret'));
 }
Ejemplo n.º 3
0
 /**
  * Renders a password field for a model attribute.
  * @param CModel $model the data model.
  * @param string $attribute the attribute.
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated input field.
  * @see TbHtml::activePasswordField
  */
 public function passwordField($model, $attribute, $htmlOptions = array())
 {
     return TbHtml::activePasswordField($model, $attribute, $htmlOptions);
 }
Ejemplo n.º 4
0
	<?php 
echo TbHtml::activePasswordField($form, 'password');
?>
	<p class="hint">
	<?php 
echo UserModule::t("Minimal password length 4 symbols.");
?>
	</p>
	</div>
	
	<div class="row-fluid">
	<?php 
echo TbHtml::activeLabelEx($form, 'verifyPassword');
?>
	<?php 
echo TbHtml::activePasswordField($form, 'verifyPassword');
?>
	</div>
	
	
	<div class="row-fluid submit">
	<?php 
echo TbHtml::button(UserModule::t('Save'), array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'submit' => ''));
?>
	</div>

<?php 
echo TbHtml::endForm();
?>
</div><!-- form -->
</div>
Ejemplo n.º 5
0
 /**
  * Renders a password field for a model attribute.
  * This method is a wrapper of {@link TbHtml::activePasswordField}.
  * Please check {@link TbHtml::activePasswordField} for detailed information
  * about the parameters for this method.
  * @param CModel $model the data model
  * @param string $attribute the attribute
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated input field
  */
 public function passwordField($model, $attribute, $htmlOptions = array())
 {
     return $this->wrapControl(TbHtml::activePasswordField($model, $attribute, $htmlOptions));
 }