コード例 #1
0
ファイル: Textarea.php プロジェクト: radex/Watermelon
 public function generate()
 {
     $code = '<textarea';
     // adding attributes
     foreach ($this as $key => $value) {
         // some object properties shouldn't be added as HTML attributes
         $dont = array('value', 'trim', 'label', 'labelNote');
         if (in_array($key, $dont)) {
             continue;
         }
         // appending attribute
         $key = strtolower($key);
         if (is_string($value) || is_int($value) || is_float($value)) {
             $code .= ' ' . $key . '="' . $value . '"';
         } elseif ($value === true) {
             $code .= ' ' . $key;
         }
     }
     // value
     $code .= '>' . htmlspecialchars($this->value) . '</textarea>';
     return parent::generate($code);
 }