Example #1
0
 public function textArea($model, $attribute, $htmlOptions = array())
 {
     if ($model->isAttributeRequired($attribute)) {
         $htmlOptions['required'] = 'required';
     }
     return parent::textArea($model, $attribute, $htmlOptions);
 }
Example #2
0
 /**
  * @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);
 }
    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");
    ?>
        </div>

        <div class="field">
            <?php 
    echo $form->labelEx($model, "[{$i}]price");
    ?>
            <?php 
    echo $form->textField($model, "[{$i}]price", array("size" => 9, "maxlength" => 9, 'class' => 'number'));
    ?>
            <?php 
    echo $form->error($model, "[{$i}]price");
    ?>
        </div>

        <div class="field">
            <?php 
    echo $form->labelEx($model, "[{$i}]limit");
    ?>
            <?php 
    echo CHtml::checkBox("unlim", true, array("id" => "limit_trig", "onclick" => '$(this).siblings("input").toggle();', "style" => "width:auto"));
    ?>
Неограничено
            <?php 
    echo $form->textField($model, "[{$i}]limit", array("size" => 10, "maxlength" => 10, "style" => "display:none"));
    ?>
            <?php 
    echo $form->error($model, "[{$i}]limit");
    ?>
        </div>

        <div class="field">
            <?php 
    echo $form->labelEx($model, "[{$i}]limit_per_user");
    ?>
            <?php 
    echo CHtml::checkBox("Coupon[{$i}][delete]", false, array("style" => "visibility:hidden", 'id' => "delete_{$i}"));
    ?>
            <?php 
    echo CHtml::checkBox("unlpu", true, array("id" => "lpu_trig", "onclick" => '$(this).siblings("input").toggle();', "style" => "width:auto"));
    ?>
Неограничено
            <?php 
    echo $form->textField($model, "[{$i}]limit_per_user", array("size" => 10, "maxlength" => 10, "style" => "display:none"));
    ?>
            <?php 
    echo $form->error($model, "[{$i}]limit_per_user");
    ?>
        </div>
    </div>
</a>
<?php 
}
?>
</div>
<?php 
$model = new Coupon();
?>
<script type="text/html" id="a-coupon" data-type="Купить скидку|Купить сертификат">
<a href="#edit" class="flag">
    <div class="percent">{{percent}}%</div>
        <div class="info">
                <div class="vd">{{price}} VD</div>
                <div class="buy">{{type}}</div>
        </div>
    <div class="hidden-form"></div>
</a>
</script>
<script type="text/html" id="coupon-form">
<div class="office-edit">
<div class="coupon-form form">
<?php 
echo CHtml::form("#");
?>
    <div class="field">
        <?php 
echo $form->hiddenField($model, "[{{id}}]type");
?>
        <?php 
echo $form->labelEx($model, "[{{id}}]text");
?>
        <?php 
echo $form->textArea($model, "[{{id}}]text", array("rows" => 6, "cols" => 50, "class" => "required"));
Example #4
0
 /**
  * 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);
 }
Example #5
0
 public function text($attribute)
 {
     $html = parent::textArea($this->model, $attribute);
     return $this->wrapField($html, $attribute);
 }