public function textArea($model, $attribute, $htmlOptions = array()) { if ($model->isAttributeRequired($attribute)) { $htmlOptions['required'] = 'required'; } return parent::textArea($model, $attribute, $htmlOptions); }
/** * @inheritDoc */ public function textArea($model, $attribute, $htmlOptions = array()) { if (!$this->qualifyNames && !isset($htmlOptions['name'])) { $htmlOptions['name'] = $attribute; } if (!isset($htmlOptions['itemprop'])) { $htmlOptions['itemprop'] = $this->getItemPropName($attribute); } return parent::textArea($model, $attribute, $htmlOptions); }
if (!$model->isNewRecord) { ?> <?php echo $form->hiddenField($model, "[{$i}]id"); ?> <?php } ?> <?php echo $form->hiddenField($model, "[{$i}]type"); ?> <?php 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");
/** * Renders a text area 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 text area */ public function textArea($parentModel, $attributedPath, $htmlOptions = array()) { list($model, $attribute, $htmlOptions) = self::resolveArgs($parentModel, $attributedPath, $htmlOptions); return parent::textArea($model, $attribute, $htmlOptions); }
public function text($attribute) { $html = parent::textArea($this->model, $attribute); return $this->wrapField($html, $attribute); }