コード例 #1
0
ファイル: FieldRenderer.php プロジェクト: netshine/scaffold
    protected function renderControl($type = null, $confirmation = false)
    {
        if (!$type) {
            $type = $this->field->type;
        }
        ?>
        <input type="<?php 
        echo $type;
        ?>
" name="<?php 
        echo ($confirmation ? 'confirm_' : '') . $this->field->name;
        ?>
" class="field-control fld-<?php 
        echo $this->field->type;
        ?>
 <?php 
        echo $this->field->css_class;
        ?>
" <?php 
        $this->outputId($confirmation ? 'confirm_' : '');
        $this->outputAttributes($this->field->attributes);
        if ($this->field->getValue($confirmation) != null) {
            echo ' value="' . $this->field->getValue($confirmation) . '"';
        }
        if ($this->field->required) {
            echo ' required="required"';
        }
        ?>
 />
        <?php 
    }
コード例 #2
0
ファイル: FieldPassword.php プロジェクト: netshine/scaffold
 public function getValue($confirmation = false)
 {
     if (!$this->value && $this->mask_length > 0) {
         return str_pad('', $this->mask_length, '*');
     } else {
         return parent::getValue($confirmation);
     }
 }