GoodForm


Button

There are two ways of adding a button field to your form object:

button (string name [, string value])

Example:

$this->goodform->button('click_me', 'ouch');

Will produce the following HTML:

<button name="click_me" >ouch</button>

button (array attributes)

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' 	=> 'click_me',
	'value'	=> 'ouch',
	'class' => 'my-button-class'
);

$this->goodform->button($attr);

Will produce the following HTML:

<button name="click_me" class="my-button-class" >ouch</button>