本文整理汇总了PHP中CActiveForm::textField方法的典型用法代码示例。如果您正苦于以下问题:PHP CActiveForm::textField方法的具体用法?PHP CActiveForm::textField怎么用?PHP CActiveForm::textField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CActiveForm
的用法示例。
在下文中一共展示了CActiveForm::textField方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: textField
public function textField($model, $attribute, $htmlOptions = array())
{
if ($model->isAttributeRequired($attribute)) {
$htmlOptions['required'] = 'required';
}
return parent::textField($model, $attribute, $htmlOptions);
}
示例2: textField
/**
* @inheritDoc
*/
public function textField($model, $attribute, $htmlOptions = array())
{
if (!$this->qualifyNames && !isset($htmlOptions['name'])) {
$htmlOptions['name'] = $attribute;
}
if (!isset($htmlOptions['itemprop'])) {
$htmlOptions['itemprop'] = $this->getItemPropName($attribute);
}
return parent::textField($model, $attribute, $htmlOptions);
}
示例3: textField
/**
* Renders a text field for a model attribute.
* @param CModel $parentModel the parent data model
* @param string $attributedPath the attribute or path to related model attribute
* @param array $htmlOptions additional HTML attributes.
* @return string the generated input field
*/
public function textField($parentModel, $attributedPath, $htmlOptions = array())
{
list($model, $attribute, $htmlOptions) = self::resolveArgs($parentModel, $attributedPath, $htmlOptions);
return parent::textField($model, $attribute, $htmlOptions);
}
示例4: array
echo $form->labelEx($model, "[{$i}]text");
?>
<?php
echo $form->textArea($model, "[{$i}]text", array("rows" => 6, "cols" => 50, 'class' => 'required'));
?>
<?php
echo $form->error($model, "[{$i}]text");
?>
</div>
<div class="field">
<?php
echo $form->labelEx($model, "[{$i}]percent");
?>
<?php
echo $form->textField($model, "[{$i}]percent", array("size" => 10, "maxlength" => 10, 'class' => 'range(1,100)'));
?>
<?php
echo $form->error($model, "[{$i}]percent");
?>
</div>
<div class="field">
<?php
echo $form->labelEx($model, "[{$i}]cost");
?>
<?php
echo $form->textField($model, "[{$i}]cost", array("size" => 60, "maxlength" => 64));
?>
<?php
echo $form->error($model, "[{$i}]cost");
示例5: input
public function input($attribute)
{
$html = parent::textField($this->model, $attribute);
return $this->wrapField($html, $attribute);
}
示例6: textField
public function textField($model, $attribute, $htmlOptions = array())
{
$htmlOptions['placeholder'] = $model->getAttributeLabel($attribute);
return $this->label($model, $attribute) . parent::textField($model, $attribute, $htmlOptions);
}