Textarea
There are two ways of adding a textarea field to your form object:
textarea (string name [, string value])
- name: defines the elements name attribute, should be unique in the object | required
- value: defines the default field value | optional
Example:
$this->goodform->textarea('about_me', 'Lorem ipsum dolor sit amet.');
Will produce the following HTML:
<textarea name="about_me" >Lorem ipsum dolor sit amet.</textarea>
d
textarea (array attributes)
- attributes: an associative array specifying attributes of the field element.
All attributes in this array will be converted to HTML element attributes. GoodForm will not check if these attributes are HTML valid. The only exceptions to this are the Special attributes that are not passed to the elements attribute string.
Example:
$attr = array(
'name' => 'about_me',
'value' => 'Lorem ipsum dolor sit amet.',
'rows' => 30,
'cols' => 15
);
$this->goodform->textarea($attr);
Will produce the following HTML:
<textarea name="about_me" rows="30" cols="15">Lorem ipsum dolor sit amet.</textarea>