Třída TTextArea je komponentou ke třídě TForm a je potomkem třídy TCheckBox. TTextArea generuje HTML kód pro zobrazení víceřádkového editačního pole ve formuláři.
<?php
class TTextArea extends TCheckBox{
protected $rows=5;
protected $cols=20;
public function __construct(){
$this->style = "TTextArea";
}
public function SetRows($num_rows){
$this->rows = (int) $num_rows;
}
public function SetCols($num_cols){
$this->cols = (int) $num_cols;
}
public function Render(){
if ($this->name == "") throw new exception("Name is empty.");
if ($this->TText_error) $code .= $this->TText_error->Render();
$code .= "<TEXTAREA name="$this->name" rows="$this->rows" cols="$this->cols" ";
if ($this->readonly) $code .= "readonly ";
if ($this->alttext !="") $code .= "title="$this->alttext" ";
if ($this->style !="") $code .= "class="$this->style" ";
$code .= ">$this->value</TEXTAREA>";
return $code;
}
}
?>