activeTextArea() public static méthode

Generates a text area input for a model attribute.
public static activeTextArea ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model.
$attribute string the attribute.
$htmlOptions array additional HTML attributes.
Résultat string the generated text area.
Exemple #1
0
<?php 
$profileFields = Profile::getFields();
if ($profileFields) {
    foreach ($profileFields as $field) {
        ?>
	<div class='row'>
		<?php 
        echo $form->labelEx($profile, $field->varname);
        ?>
		<?php 
        if ($widgetEdit = $field->widgetEdit($profile)) {
            echo $widgetEdit;
        } elseif ($field->range) {
            echo $form->dropDownList($profile, $field->varname, Profile::range($field->range));
        } elseif ($field->field_type == 'TEXT') {
            echo TbHtml::activeTextArea($profile, $field->varname, array('rows' => 6, 'cols' => 50));
        } else {
            echo $form->textField($profile, $field->varname, array('size' => 60, 'maxlength' => $field->field_size ? $field->field_size : 255));
        }
        ?>
		<?php 
        echo $form->error($profile, $field->varname);
        ?>
	</div>
			<?php 
    }
}
?>
	

<?php 
 public function testActiveTextArea()
 {
     $I = $this->codeGuy;
     $html = TbHtml::activeTextArea(new Dummy(), 'textarea', array('class' => 'textarea'));
     $textarea = $I->createNode($html, 'textarea');
     $I->seeNodeAttributes($textarea, array('class' => 'textarea', 'id' => 'Dummy_textarea', 'name' => 'Dummy[textarea]'));
     $I->seeNodeText($textarea, 'Textarea text');
 }
 /**
  * Renders a text area 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 text area.
  * @see TbHtml::activeTextArea
  */
 public function textArea($model, $attribute, $htmlOptions = array())
 {
     return TbHtml::activeTextArea($model, $attribute, $htmlOptions);
 }
Exemple #4
0
 /**
  * Renders a text area for a model attribute.
  * This method is a wrapper of {@link TbHtml::activeTextArea}.
  * Please check {@link TbHtml::activeTextArea} 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 text area
  */
 public function textArea($model, $attribute, $htmlOptions = array())
 {
     return $this->wrapControl(TbHtml::activeTextArea($model, $attribute, $htmlOptions));
 }
Exemple #5
0
		<?php 
echo $form->labelEx($description, 'meta_description');
?>
		<?php 
echo TbHtml::activeTextArea($description, 'meta_description');
?>
		<?php 
echo $form->error($description, 'meta_description');
?>
		</div><!-- row -->
		<div class="row">
		<?php 
echo $form->labelEx($description, 'meta_keyword');
?>
		<?php 
echo TbHtml::activeTextArea($description, 'meta_keyword');
?>
		<?php 
echo $form->error($description, 'meta_keyword');
?>
		</div><!-- row -->
		<div class="row">
		<?php 
echo $form->labelEx($model, 'store_id');
?>
		<?php 
echo $form->dropDownList($model, 'store_id', TbHtml::listData(Store::model()->findAll(array('order' => 'name')), 'id', 'name'));
?>
		<?php 
echo $form->error($model, 'store_id');
?>
 public function testActiveTextArea()
 {
     $I = $this->codeGuy;
     $html = TbHtml::activeTextArea(new Dummy(), 'textarea', array('class' => 'textarea'));
     $textarea = $I->createNode($html, 'textarea.form-control');
     $I->seeNodeAttributes($textarea, array('class' => 'textarea form-control', 'id' => 'Dummy_textarea', 'name' => 'Dummy[textarea]'));
     $I->seeNodeText($textarea, 'Textarea text');
     $html = TbHtml::activeTextArea(new Dummy(), 'textarea', array('xs' => 6, 'md' => 6, 'class' => 'textarea'));
     $div = $I->createNode($html, 'div');
     $I->seeNodeCssClass($div, 'col-xs-6');
     $I->seeNodeCssClass($div, 'col-md-6');
     $textarea = $div->filter('textarea');
     $I->seeNodeAttributes($textarea, array('class' => 'textarea form-control', 'id' => 'Dummy_textarea', 'name' => 'Dummy[textarea]'));
     $I->seeNodeText($textarea, 'Textarea text');
 }