Tired of writing repetitive HTML for forms?
Create forms faster and maintain them easier with a form helper class.

Text Input

$object->input($label,$name,$value,$params);

Example: $form->input(‘First Name:’,’first_name’,’Joe’,array(‘size’=>’10’));

This will create the following:

<label for=”first_name”>First Name:</label> <input type=”text” name=”first_name” value=”Joe” size=”10″ />

The $params array can be any parameter you want it to be. You can put classes, styles, etc.
$value and $params are optional.

TextArea

$object->textarea($label,$name,$value,$params);

Example: $form->textarea(‘Comment:’,’comment’,’This is my comment.’,array(‘rows’=>’10’));

This will create the following:

<label for=”comment”>Comment:</label><textarea name=”comment” rows=”10″>This is my comment.</textarea>

The $params array can be any parameter you want it to be. You can put classes, styles, etc.
$value and $params are optional.

Select Dropdown

$object->select($label,$name,$value,$params);

Example: $form->select(‘How many kids do you have?’,’number_of_kids’,array(0,1,2,3,4));

This will create the following:

<label for=”number_of_kids”>How many kids do you have?</label><select name=”number_of_kids”>

<option value=”0″>0</option>

<option value=”1″>1</option>

<option value=”2″>2</option>

<option value=”3″>3</option>

<option value=”4″>4</option>

</select>

The $params array can be any parameter you want it to be. You can put classes, styles, etc.
$params are optional.

This class doesn’t have the option to create checkboxes or radio buttons, but that is definitely on the way in a future update. I hope this class helps you as much as it helps me out.