activeUrlField() публичный статический Метод

Generates an url field input for a model attribute.
См. также: self::activeTextInputField
public static activeUrlField ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model.
$attribute string the attribute.
$htmlOptions array additional HTML attributes.
Результат string the generated input field.
Пример #1
0
 /**
  * Renders a url 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::activeUrlField
  */
 public function urlField($model, $attribute, $htmlOptions = array())
 {
     return TbHtml::activeUrlField($model, $attribute, $htmlOptions);
 }
Пример #2
0
 public function testActiveUrlField()
 {
     $I = $this->codeGuy;
     $html = TbHtml::activeUrlField(new Dummy(), 'url', array('class' => 'input'));
     $input = $I->createNode($html, 'input[type=url]');
     $I->seeNodeAttributes($input, array('class' => 'input', 'id' => 'Dummy_url', 'name' => 'Dummy[url]', 'value' => 'http://www.getyiistrap.com'));
 }
Пример #3
0
 /**
  * Renders a url field for a model attribute.
  * This method is a wrapper of {@link TbHtml::activeUrlField}.
  * Please check {@link TbHtml::activeUrlField} 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 Yii 1.1.11
  */
 public function urlField($model, $attribute, $htmlOptions = array())
 {
     return $this->wrapControl(TbHtml::activeUrlField($model, $attribute, $htmlOptions));
 }