Correct definition form class
<p>i have class </p>

<pre><code>class Form {

public function addTextarea(array $par){

$element='. $par['label'] .';
$element .= '&lt;textarea name="'. $par['name'] .'" id="'.  $par['id'] .'" cols="'.  $par['cols'] .'" rows="'.  $par['rows'] .'" class="' $par['class'] '"&gt;&lt;/textarea&gt;'  ;
return $element;

}

// another form elements

}

$tab1 = array (
    'name'=&gt;'newsletter',
    'id'=&gt;'nwsltr',
    'cols'=&gt;'10',
    'rows'=&gt;'5',
    'class'=&gt;'newsletter',
    'label'=&gt;'Subscribe',   
    'value'=&gt; $_POST['email']
);


    $ob-&gt;new Form;
    print $ob-&gt;addTextarea($tab1);
</code></pre>

<p>Did this pattern is good ? How i  can simple write array, another write class ?</p>
