activeRangeField() public static method

Generates a range field input for a model attribute.
See also: self::activeTextInputField
public static activeRangeField ( 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.
 /**
  * Generates a range 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::activeRangeField
  */
 public function rangeField($model, $attribute, $htmlOptions = array())
 {
     return TbHtml::activeRangeField($model, $attribute, $htmlOptions);
 }
Example #2
0
 public function testActiveRangeField()
 {
     $I = $this->codeGuy;
     $html = TbHtml::activeRangeField(new Dummy(), 'range', array('class' => 'input'));
     $input = $I->createNode($html, 'input[type=range]');
     $I->seeNodeAttributes($input, array('class' => 'input', 'id' => 'Dummy_range', 'name' => 'Dummy[range]', 'value' => '3.33'));
 }
Example #3
0
 /**
  * Generates a range field for a model attribute.
  * This method is a wrapper of {@link TbHtml::activeRangeField}.
  * Please check {@link TbHtml::activeRangeField} 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
  * @since 1.1.11
  */
 public function rangeField($model, $attribute, $htmlOptions = array())
 {
     return $this->wrapControl(TbHtml::activeRangeField($model, $attribute, $htmlOptions));
 }