[eluser]danmontgomery[/eluser]
Well, your two examples for the input aren't the same, so of course the html looks cleaner. The equivalent would be:
Code:
echo form_input('firstname');
Which doesn't really seem harder or easier, it's just preference. The value of the helper functions comes when passing values to those inputs.
Code:
<input type="text" name="firstname" value="<?php if(isset($_POST['firstname'])) echo $_POST['firstname']; ?>"/>
// vs
echo form_input('firstname', set_value('firstname'));
This is even more apparent with selects:
Code:
<select name="type">
<option value="1"<?php if(isset($_POST['type']) && $_POST['type'] == 1) echo ' selected="selected"'; ?>>www.this.com</option>
<option value="2"<?php if(isset($_POST['type']) && $_POST['type'] == 2) echo ' selected="selected"'; ?>>www.that.com</option>
<option value="3"<?php if(isset($_POST['type']) && $_POST['type'] == 3) echo ' selected="selected"'; ?>>www.theother.com</option>
</select>
// vs
$urlarray = array(
'1' => 'www.this.com',
'2' => 'www.that.com',
'3' => 'www.theother.com',
);
echo form_dropdown('type', $urlarray, set_value('type', 1));